Hi Markus,
You say you are running JWebUnit example, could you be more precise, because I
don't know any JWebUnit example that connect to http://branch.vistanet/.
JavaScript errors are very often dependent on the testing engine (currently
HtmlUnit). If JavaScript is not required for your test, you can try to disable
it:
setScriptingEnabled(false);
++
Julien
----- Message d'origine ----
De : Markus Loane <[EMAIL PROTECTED]>
À : [email protected]
Envoyé le : Lundi, 29 Janvier 2007, 10h16mn 50s
Objet : [JWebUnit-development] FW: Problems with struts, property not fixed
<!--
_filtered {font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
span.EmailStyle17
{
font-family:Arial;
color:windowtext;}
span.EmailStyle18
{
font-family:Arial;
color:navy;}
span.EmailStyle19
{
font-family:Arial;
color:navy;}
_filtered {
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
{}
-->
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(JavaScriptEngine.java:253)
at
com.gargoylesoftware.htmlunit.html.HtmlPage.loadExternalJavaScriptFile(HtmlPage.java:776)
at
com.gargoylesoftware.htmlunit.html.HtmlScript.executeScriptIfNeeded(HtmlScript.java:188)
at
com.gargoylesoftware.htmlunit.html.HtmlPage.notifyNodeAdded(HtmlPage.java:1395)
at com.gargoylesoftware.htmlunit.html.DomNode.appendChild(DomNode.java:476)
at
com.gargoylesoftware.htmlunit.html.HTMLParser$HtmlUnitDOMBuilder.startElement(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:1009)
at org.cyberneko.html.HTMLTagBalancer.startElement(HTMLTagBalancer.java:639)
at
org.cyberneko.html.HTMLScanner$ContentScanner.scanStartElement(HTMLScanner.java: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(HTMLParser.java:311)
at com.gargoylesoftware.htmlunit.html.HTMLParser.parse(HTMLParser.java:226)
at
com.gargoylesoftware.htmlunit.DefaultPageCreator.createHtmlPage(DefaultPageCreator.java:112)
at
com.gargoylesoftware.htmlunit.DefaultPageCreator.createPage(DefaultPageCreator.java:85)
at
com.gargoylesoftware.htmlunit.WebClient.loadWebResponseInto(WebClient.java:431)
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(JavaScriptEngine.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
___________________________________________________________________________
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions !
Profitez des connaissances, des opinions et des expériences des internautes sur
Yahoo! Questions/Réponses
http://fr.answers.yahoo.com-------------------------------------------------------------------------
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