Hi Eric,

I'm not sure but it seems to me that the library you use tries to use some Firefox reserved properties/functions to add new properties and that this isn't (yet) supported by HtmlUnit.

Do you have some publicly available example of this problem?

Cheers,
Marc.
--
Blog: http://mguillem.wordpress.com


Eric Soares wrote:
I just installed WebTest (and therefore very very new to this) and I’m trying to do a basic proof of concept by logging in to my app. When I attempt to invoke the login URL I get the error message below in the results. I’m not even getting to the point of attempting to log in. I’m getting this error during the loading of the login page.

Am I missing something? Is there some parameter I should be setting to deal with this JS?

Thanks for any help.

---Eric

*Message*

JavaScript error loading page https://ststage.navis.com/occam/app: TypeError: Cannot call method "__defineGetter__" of undefined (https://ststage.navis.com/occam/app?digest=45a31718fe49c94b1382419fa2bf2cf5&service=asset&path=%2Fcom%2Fnavis%2Foccam%2Fweb%2Fcomponents%2Fdesktop%2Fresources%2FieEmulation.js#44)

*Location*

C:\N4\occam-dev\occam\webtest\SmartTurnPOC\tests\login.xml (line: 18)

*Details*

javascript error

        

TypeError: Cannot call method "__defineGetter__" of undefined (https://ststage.navis.com/occam/app?digest=45a31718fe49c94b1382419fa2bf2cf5&service=asset&path=%2Fcom%2Fnavis%2Foccam%2Fweb%2Fcomponents%2Fdesktop%2Fresources%2FieEmulation.js#44)

line

        

44

javascript source

        

/************************************************************************ ***** This script contains modifications to Mozilla prototypes that ***** allow Mozilla-based browsers to emulate proprietary IE ***** functionality. It also contains modification to functions that ***** are standard to later DOM browsers to emulate or patch behaviors ***** in the earlier versions. ***** ************************************************************************** ***** ***** This file depends upon the following JavaScript files: ***** -none ***** *************************************************************************/ /************************************************************************/ /**** Mozilla doesn't have a click() method for some tags. The ****/ /**** following code creates one. ****/ /************************************************************************/ if(typeof HTMLAnchorElement!="undefined" && !HTMLAnchorElement.prototype.click) { HTMLAnchorElement.prototype.click = function() { var evt = this.ownerDocument.createEvent('MouseEvents'); evt.initMouseEvent('click', true, true, this.ownerDocument.defaultView, 1, 0, 0, 0, 0, false, false, false, false, 0, null); this.dispatchEvent(evt); } } if(typeof HTMLTableRowElement!="undefined" && !HTMLTableRowElement.prototype.click) { HTMLTableRowElement.prototype.click = function() { var evt = this.ownerDocument.createEvent('MouseEvents'); evt.initMouseEvent('click', true, true, this.ownerDocument.defaultView, 1, 0, 0, 0, 0, false, false, false, false, 0, null); this.dispatchEvent(evt); } } /************************************************************************/ /**** Mozilla will return a text node (if one exists) for ****/ /**** srcElement. The following will force Moz to always return an ****/ /**** element. ****/ /************************************************************************/ if(typeof Event!="undefined") { Event.prototype.__defineGetter__("srcElement", function () { try { var node = this.target; while (node.nodeType != 1) node = node.parentNode; return node; } catch(e){ return; } }); } /************************************************************************/ /**** Mozilla uses layerY and layerX instead of offsetX and offsetY. ****/ /**** The following reconciles the two. ****/ /************************************************************************/ if(typeof Event!="undefined") { Event.prototype.__defineGetter__("offsetX", function () { return this.layerX; }); Event.prototype.__defineGetter__("offsetY", function () { return this.layerY; }); } /************************************************************************/ /**** Forces Mozilla to exhibit same behavior as IE when getting ****/ /**** and setting innerText (i.e, it will ignore surrounding HTML ****/ /**** objects and get/set only display text). ****/ /************************************************************************/ if (typeof HTMLAnchorElement!="undefined") { HTMLElement.prototype.__defineSetter__("innerText", function (txt) { var rng = document.createRange() rng.selectNodeContents(this) rng.deleteContents() var newText = document.createTextNode(txt) this.appendChild(newText) return txt }); HTMLElement.prototype.__defineGetter__("innerText", function () { var rng = document.createRange() rng.selectNode(this) return rng.toString() }); } /************************************************************************/ /**** These functions emulate the insertAdjacentHTML function for ****/ /**** NS6/Mozilla. ****/ /**** ****/ /************************************************************************/ /**** ****/ /**** Parameters: ****/ /**** sWhere - String that specifies where to insert the ****/ /**** HTML text, using one of the following ****/ /**** values: ****/ /**** [beforeBegin]- Inserts sText immediately before the object. ****/ /**** [afterBegin] - Inserts sText after the start of the object ****/ /**** but before all other content in the object. ****/ /**** [beforeEnd] - Inserts sText immediately before the end of ****/ /**** the object but after all other content in ****/ /**** the object. ****/ /**** [afterEnd] - Inserts sText immediately after the end of ****/ /**** the object. ****/ /**** sText - String that specifies the HTML text to ****/ /**** insert. The string can be a combination of ****/ /**** text and HTML tags. This must be well-formed,****/ /**** valid HTML or this method will fail. ****/ /**** ****/ /************************************************************************/ // insertAdjacentHTML(), insertAdjacentText() and insertAdjacentElement() // for Netscape 6/Mozilla by Thor Larholm [EMAIL PROTECTED] if(typeof HTMLElement!="undefined" && !HTMLElement.prototype.insertAdjacentElement) { HTMLElement.prototype.insertAdjacentElement = function (where,parsedNode) { switch (where){ case 'beforeBegin': this.parentNode.insertBefore(parsedNode,this) break; case 'afterBegin': this.insertBefore(parsedNode,this.firstChild); break; case 'beforeEnd': this.appendChild(parsedNode); break; case 'afterEnd': if (this.nextSibling) this.parentNode.insertBefore(parsedNode,this.nextSibling); else this.parentNode.appendChild(parsedNode); break; } } HTMLElement.prototype.insertAdjacentHTML = function (where,htmlStr) { var r = this.ownerDocument.createRange(); r.setStartBefore(this); var parsedHTML = r.createContextualFragment(htmlStr); this.insertAdjacentElement(where,parsedHTML) } HTMLElement.prototype.insertAdjacentText = function (where,txtStr) { var parsedText = document.createTextNode(txtStr) this.insertAdjacentElement(where,parsedText) } } /************************************************************************/ /**** Allows Mozilla to use cancelBubble=true. ****/ /************************************************************************/ if (typeof Event!="undefined") { Event.prototype.__defineSetter__("cancelBubble", function (b) { if (b) this.stopPropagation(); }); }

failing line

        

Event.prototype.__defineGetter__("srcElement", function () {

javascript call stack

        

TypeError: Cannot call method "__defineGetter__" of undefined (https://ststage.navis.com/occam/app?digest=45a31718fe49c94b1382419fa2bf2cf5&service=asset&path=%2Fcom%2Fnavis%2Foccam%2Fweb%2Fcomponents%2Fdesktop%2Fresources%2FieEmulation.js#44) at (https://ststage.navis.com/occam/app?digest=45a31718fe49c94b1382419fa2bf2cf5&service=asset&path=%2Fcom%2Fnavis%2Foccam%2Fweb%2Fcomponents%2Fdesktop%2Fresources%2FieEmulation.js:44)



_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest

Reply via email to