The error is the result of "navigator.userAgent" returning null.
The fix, set the user agent
WebTester tester = new WebTester();
tester.getTestContext().setUserAgent("HTMLUNIT");

You could also set it to IE/Firefox/whatever

---------------------------------------------------------------------------------------------------------
Original Message:
I am using Jwebunit to run the functional test for a webpage, and I
have encountered the following error when using beginAt(url):

======= EXCEPTION START ========
EcmaError: lineNumber=[9] column=[0] lineSource=[var Prototype = {]
name=[TypeError] sourceName=[http://localhost:8080/cinnamon/js/
prototype.js] message=[TypeError: Cannot call method "indexOf" of null
(http://localhost:8080/cinnamon/js/prototype.js#9)]
com.gargoylesoftware.htmlunit.ScriptException: TypeError: Cannot call
method "indexOf" of null (http://localhost:8080/mysite/js/
prototype.js#9)

......

Looks like there is a htmlunit issue with prototype.js. Anyone has any
idea to solve this issue? Thanks.
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
JWebUnit-users mailing list
JWebUnit-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jwebunit-users

Reply via email to