_____
From: Markus Loane [mailto:[EMAIL PROTECTED]
Sent: Monday, 29 January 2007 7:16 PM
To: [email protected]
Subject: FW: Problems with struts, property not fixed
_____
From: Markus Loane [mailto:[EMAIL PROTECTED]
Sent: Monday, 29 January 2007 7:11 PM
To: '[email protected]'
Subject: Problems with struts, property not fixed
I have just started using jwebunit after having used seleniumRC for around
6mths.
The problem I am having is when I run the example on the JWebUnit page I get
the following error:
com.gargoylesoftware.htmlunit.ScriptException: [object Error]
(http://branch.vistanet/portal/struts/dojo/dojo.js#77)
======= EXCEPTION START ========
Exception class=[org.mozilla.javascript.JavaScriptException]
com.gargoylesoftware.htmlunit.ScriptException: [object Error]
(http://branch.vistanet/portal/struts/dojo/dojo.js#77)
at
com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScript
Engine.java:253)
at
com.gargoylesoftware.htmlunit.html.HtmlPage.loadExternalJavaScriptFile(HtmlP
age.java:776)
at
com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScri
pt.java:188)
at
com.gargoylesoftware.htmlunit.html.HtmlPage.notifyNodeAdded(HtmlPage.java:13
95)
at
com.gargoylesoftware.htmlunit.html.DomNode.appendChild(DomNode.java:476)
at
com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.startElemen
t(HTMLParser.java:359)
at
org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
at
org.cyberneko.html.filters.DefaultFilter.startElement(DefaultFilter.java:179
)
at
org.cyberneko.html.filters.NamespaceBinder.startElement(NamespaceBinder.java
:286)
at
org.cyberneko.html.HTMLTagBalancer.callStartElement(HTMLTagBalancer.java:100
9)
at
org.cyberneko.html.HTMLTagBalancer.startElement(HTMLTagBalancer.java:639)
at
org.cyberneko.html.HTMLScanner$ContentScanner.scanStartElement(HTMLScanner.j
ava:2407)
at
org.cyberneko.html.HTMLScanner$ContentScanner.scan(HTMLScanner.java:1881)
at
org.cyberneko.html.HTMLScanner.scanDocument(HTMLScanner.java:809)
at
org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:478)
at
org.cyberneko.html.HTMLConfiguration.parse(HTMLConfiguration.java:431)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at
com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.parse(HTMLP
arser.java:311)
at
com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:226)
at
com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageC
reator.java:112)
at
com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreat
or.java:85)
at
com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:4
31)
at
com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:335)
at
com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:389)
at
net.sourceforge.jwebunit.htmlunit.HtmlUnitDialog.beginAt(HtmlUnitDialog.java
:120)
at
net.sourceforge.jwebunit.WebTester.beginAt(WebTester.java:152)
at
net.sourceforge.jwebunit.WebTestCase.beginAt(WebTestCase.java:88)
at
gov.qiris.functest.ExampleWebTestCase.testLoginPage(ExampleWebTestCase.java:
64)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at
net.sourceforge.jwebunit.WebTestCase.runBare(WebTestCase.java:50)
at
com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at
com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
Caused by: org.mozilla.javascript.JavaScriptException: [object Error]
(http://branch.vistanet/portal/struts/dojo/dojo.js#77)
at
org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:2460)
at
org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2250)
at
org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:149
)
at
org.mozilla.javascript.ScriptRuntime.applyOrCall(ScriptRuntime.java:2169)
at
org.mozilla.javascript.BaseFunction.execIdCall(BaseFunction.java:254)
at
org.mozilla.javascript.IdFunctionObject.call(IdFunctionObject.java:124)
at
org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3084)
at
org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2250)
at
org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:149
)
at
org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:337)
at
org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2755)
at
org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:160
)
at
org.mozilla.javascript.Context.evaluateString(Context.java:1132)
at
com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine.execute(JavaScript
Engine.java:249)
... 51 more
JavaScriptException value = Error: Could not load 'struts.widgets.Bind';
last tried '__package__.js'
== CALLING JAVASCRIPT ==
dojo.require("dojo.io.BrowserIO");
dojo.require("dojo.event.topic");
dojo.hostenv.setModulePrefix('struts', 'struts');
dojo.require('dojo.widget.*');
dojo.widget.manager.registerWidgetPackage('struts.widgets');
dojo.require("struts.widgets.Bind");
dojo.require("struts.widgets.BindDiv");
dojo.require("struts.widgets.BindButton");
dojo.require("struts.widgets.BindAnchor");
dojo.require("dojo.widget.Editor");
dojo.hostenv.writeIncludes(); // not needed, but allows the Venkman debugger
to work with the includes
======= EXCEPTION END ========
I believe it may be related to the 'hostenv' value being dynamically set and
the beginAt method mucks up the path to the js file.
Is there a method to set the hotenv properties?? Using HttpUnit methods
loads the page with no problems.
Other than that I am stuck..The code I run is just the code from the example
on the jwebunit site, with the addition of setting the "setUserAgent" to
'MSIE' which alleviated another error I was having.
Any help would be greatly appericated.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
JWebUnit-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jwebunit-development