Unable to test Pages that use JavaScript

View: New views
2 Messages — Rating Filter:   Alert me  

Unable to test Pages that use JavaScript

by Hernan Castagnola :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have been using webtest for a while disabling JS beacuse of the error that returns.
Right now I must test some stuff that is being loaded by a js funcition:

1var xhReq;
2var dtDate = new Date();
3var surl = '/ajax/sessioninfo.php?rnd=' + dtDate.getSeconds() + '&slc=' + language_id + '&nfwk=1';
5if (window.XMLHttpRequest)
6 xhReq = new XMLHttpRequest();
7else
8 xhReq = new ActiveXObject("Microsoft.XMLHTTP");
10xhReq.open("GET", surl, false);
11xhReq.send(null);
12document.getElementById('my_olx').innerHTML = xhReq.responseText;


But as I have the following step :
ant.enableJavaScript enable:"false" 

 when I do the invoke step the inner html under "my_olx" is not being loaded. So I can't test it. 

I tried enabling the js and simulating IE7 and FF3 without any success. I still get the error. I must enable it because I need that inner html to be loaded.

does anyone succeed testing web pages that uses js with webtest?

This is the site I am testing: www.olx.com

Thanks in advance,

Hernan

Re: Unable to test Pages that use JavaScript

by Hernan Castagnola :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I send you the Js that is failling so that it can be included as a fix:

page: www.olx.com
error:JavaScript error loading page http://www.olx.com/: SyntaxError: illegal character (http://static04.olx.com/js/compressed/protoculous.compressed-31.js#1(eval)#1)

SyntaxError: illegal character (http://static04.olx.com/js/compressed/protoculous.compressed-31.js#1(eval)#1) at (http://static04.olx.com/js/compressed/protoculous.compressed-31.js:1)

JS

Go to this url: http://static04.olx.com/js/compressed/protoculous.compressed-31.js


I hope it helps



2009/10/19 Hernan Castagnola <castagnolah@...>
I have been using webtest for a while disabling JS beacuse of the error that returns.
Right now I must test some stuff that is being loaded by a js funcition:

1var xhReq;
2var dtDate = new Date();
3var surl = '/ajax/sessioninfo.php?rnd=' + dtDate.getSeconds() + '&slc=' + language_id + '&nfwk=1';
5if (window.XMLHttpRequest)
6 xhReq = new XMLHttpRequest();
7else
8 xhReq = new ActiveXObject("Microsoft.XMLHTTP");
10xhReq.open("GET", surl, false);
11xhReq.send(null);
12document.getElementById('my_olx').innerHTML = xhReq.responseText;


But as I have the following step :
ant.enableJavaScript enable:"false" 

 when I do the invoke step the inner html under "my_olx" is not being loaded. So I can't test it. 

I tried enabling the js and simulating IE7 and FF3 without any success. I still get the error. I must enable it because I need that inner html to be loaded.

does anyone succeed testing web pages that uses js with webtest?

This is the site I am testing: www.olx.com

Thanks in advance,

Hernan