Runtime Change of an Object in Web Browser during Automation using sahi - javascript

I am using Sahi as the Automation tool but I have a problem identifying one of the fields.The field gets changed during runtime and I am unable to catch it.
I am attaching the image here.
The fields Read and Skipped are both identified by the below properties:
Read
_div("0[1]")
_div("cell-right fg-000000[1]")
_div(613)
Skipped
_div("0")
_div("cell-right fg-000000")
_div(615)
However the array [1] gets on interchanging and i am getting the below error everytime i execute the script.
_sahi.setServerVarForFetch('___lastValue___1429772452227', _getText(_div("cell-right fg-000000[1]"))); [9205 ms] [12:31:00.321]
Error: The parameter passed to _getText was not found on the browser
at: (C:\sahi_pro\userdata\scripts\TLMRP.sah&n=40) checkFileExist
Please help as to how to identify the same.

If I understand correctly and you just have this field which id is changing, use a regular expression to get it
_div(/fg-000000/)

Related

Unknown iOS Chrome Javascript error - fillForm

Through a bug reporting framework, I've received a number of javascript errors coming from Chrome on iOS (multiple users). I suspect they have to do with Chrome's autofill.
The error is:
TypeError: null is not an object (evaluating 'c.addEventListener')
Where c varies (probably due to our script minification).
The stack trace indicates it's not coming from our script, but from somewhere on the page
index.html:11 fillForm
index.html:1 global code
Additionally, it appears that the last thing the user does is click on an input element.
Has anyone experienced this before? Does anyone know what's causing this error or how to prevent it?
This type of errors occurs when you try to execute method on null object. In your situation 'c' is null. That's why you have this error. If this string of code is yours (c.addEventListner), then simply add check for null and execute code if it's not null. If this part is from the framework, then you should check why your modifications makes it null. If not, fill bug report to framework development team.

Including Date Range Selector for Google Analytics api implementation

I've been trying to implement the date range selector by following the demo in https://ga-dev-tools.appspot.com/embed-api/custom-components/ But, whenever I try to test my script, I get errors.
For these scripts,
/public/javascript/embed-api/date-range-selector.js"
/public/javascript/embed-api/components/date-range-selector.js"
I get a 404 error saying that the scripts are not found. Whenever I check my sources in the browser, the generated .js files are blank.
Additionally, I tried this:
https://ga-dev-tools.appspot.com/public/javascript/embed-api/components/date-range-selector.js
And I got an error saying that gapi was undefined.
How am I supposed to include this js to my project so I can implement it? I've also already disabled AdBlock if that means anything.

jQuery.tokenInput.js script in JavaScript not working

I am making an application that is purely out of JavaScript (frontend and backend). So now I am using jQuery.tokenInput.js and I am having some troubles with the plugin recognizing the script.
First of all, it's not logging any error messages so I don't even know if it's an issue on my end or not.
I've essentially created a route in the application /autocomplete/tags and it accepts q parameter as well.
So when I type in something like this /autocomplete/tags?q=r I get the following result on the page
[{"tag_name":"Android","_id":"ooJaBpZ6MShmzbshY"},{"tag_name":"RPG","_id":"KpvAqCRqKKP5rbGLD"}]
So now when I initialize the plugin like this
$('#tag_input').tokenInput("/autocomplete/tags", {
theme: "facebook",
propertyToSearch: "tag_name",
tokenLimit: 5
});
It changes the input and everything. I've even tried with constant data and it seems to work but not with a script for some reason.
Is there a way I can debug/troubleshoot? Can I somehow turn on logging for this plugin? I don't actually see any issue with the way that I am doing it. I've looked at the demos and they return JSON in exactly the same way.
If you've got any ideas, it would be great!
The JSON returned from an external service must be returned under an application/json header type - we found that this service was returning text/html instead.
Information about how to specify the content type with Meteor can be found on this question.

Crm 2011 with no javascript customizations gives onload errors

we are getting the following error in almost all create or edit entity forms. the systems is not customized at all and it works perfectly:
There was an error in the fields customized event.
field:window
event:onload
error:object doesn't support this property or method
after debugging the error I found out that it is happening in FormScript.js.aspx page in the following code block:
var eContext=Mscrm.FormUtility.constructExecutionObject(eventObj,0,null,null);
eContext=Mscrm.FormUtility.constructExecutionObject(eventObj,0,null,eContext)
Mscrm.Form_onload();
Mscrm.Form_onload() is what causing the error to happen.
do you have any idea why is this happening?
It was a server side problem. I don't know exactly why it happens. we also tried to do an installation repair but that didn't solve it. Finally, we installed a fresh CRM 2011 copy on a new server, imported the database and ran Data migration manager. and the error disappeared.
Are you absolutely positive there is no script attached to run on load of any of the entities that are having issues? That particular function should just run any custom script you have on the entity, so I don't see any other cause.
Odd, there is certainly some garbage in there somewhere
function crmForm_window_onload_handler(eventObj,eventArgs){
try{
var eContext=Mscrm.FormUtility.constructExecutionObject(eventObj,0,null,null);
eContext=Mscrm.FormUtility.constructExecutionObject(eventObj,0,null,eContext)
loadInsideView();
eContext=Mscrm.FormUtility.constructExecutionObject(eventObj,1,null,eContext)
CEI.Initialize();
} catch(e) {
displayError('window', 'onload', e.description);
}
}
Here is one from our system on the account form. I have no idea how this could have happened, but I would check the events for the page (not just the onload). I would also try adding a JavaScript web resource with a generic event to the onload to see if by toggling it on, the system might clean itself up. You may have to call Microsoft or find the issue in your 4.0 and fix it to do another re-install. I feel for you on this one!

Debugging an error message in Firebug

I get this error message in Firebug:
Permission denied for <http://googleads.g.doubleclick.net> to call method Location.toString
It comes from this page:
http://www.comehike.com/outdoors/trees/add_spotted_trees.php?hike_id=108
The login credentials for this page are:
test#comehike.com | password
When I look at it in Firebug, using the Console --> Errors view, I see that error first, followed by a number of other errors, but I can't really double-click on the errors to see what line they are coming from, and the line isn't written there as far as I can see. There are some line references on the page, but they lead to pretty random spots.
Any ideas how to debug such a thing? I am new to JS and FireBug.
Thanks,
Alex
The Location.toString error is usually due to some ad-serving javascript code, trying to get a text version of the current page's location. Firefox denies access to this information to 3rd party scripts by default, since 3rd party scripts should have no business knowing exactly what page you're on.
Basically it's an attempt by ad networks to work around some clients not sending referers, by trying to grab the location data directly.
In firebug under the "bug" icon (upper left when open) you'll see a pause button (in the console tab). This will cause the page to stop loading and jump to the exact error in the script.
However, when I visited the page I do not see any errors.
body' onLoad is:
initializeTreeHike( , );
You don't need to use comma if you wish to pass no parameters to the function.
When I follow the provided link in Firefox 4.0 with Firebug 1.7, I don't receive the error you encountered. What I do receive however is the following:
Syntax error: initializeTreeHike( , );
It appears this is coming from line 326 in add_spotted_trees.php in the following line:
<body onload="initializeTreeHike( , );"
Perhaps you meant to pass in empty strings as parameters?

Categories

Resources