Hi Stefanie,
this is a problem in htmlunit which define the property "all" only for
the document element and not for all nodes (when simulating IE). Please
open an issue there
http://sourceforge.net/tracker/?group_id=47038&atid=448266
Marc.
Stefanie Wilms wrote:
Hi,
here a problem with 'clickButton'. I get the following error message:
com.canoo.webtest.engine.StepFailedException:
Step[clickButton "Add value" (16/16)]: Script error loading page executing webtest at:
clickButton Wrapped com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot read property "length" from undefined (http://localhost:8080/tra/javascript/WebAutoClose.js#18) (http://localhost:8080/tra/javascript/WebOpenCentered.js#24) Source code: function () { [native code, arity=0] } ,
WebAutoClose.js#18:
var bwtimerid;
function bwInitAutoClose() {
bwChangeOnFocusHandlers();
window.onblur = bwAutoCloseWin;
}
function bwAutoCloseWin () {
bwtimerid = setTimeout('window.close()', 30);
}
function bwCancelCloseWin (evt) {
clearTimeout(bwtimerid);
}
function bwChangeOnFocusHandlers () {
if (document.all) {
for (var e = 0; e < document.body.all.length; e++) {
if (document.body.all[e].onfocus) {
document.body.all[e].oldOnfocus =
document.body.all[e].onfocus;
document.body.all[e].onfocus = function (evt) {
bwCancelCloseWin(evt);
this.oldOnfocus(evt);
};
} else {
document.body.all[e].onfocus = bwCancelCloseWin;
}
}
window.onfocus = bwCancelCloseWin;
} else if (document.getElementsByTagName) {
var all = document.getElementsByTagName('*');
for (var e = 0; e < all.length; e++) {
if (all[e].getAttribute('onfocus')) {
all[e].onfocus = new Function ('evt',
'bwCancelCloseWin(evt); ' + all[e].getAttribute('onfocus') + '; return true;');
} else {
all[e].onfocus = bwCancelCloseWin;
}
}
window.onfocus = bwCancelCloseWin;
} else {
alert("The browser you use does not support auto close.");
}
}
bwInitAutoClose();
Thanks in advance,
Stefanie Wilms
_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest
_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest