[Webtest] Re: AJAX (DWR) webtest Compatability

Richard HALLIER webtest@lists.canoo.com
Wed, 7 Dec 2005 16:29:20 +0100


Thank you for your fast reply, Marc.
Is the R_1041 version of Canoo Web Test integrating the latest cvs =
snapshot of htmlunit ?
R.

-----Message d'origine-----
De : webtest-admin@lists.canoo.com
[mailto:webtest-admin@lists.canoo.com]De la part de Marc Guillemot
Envoy=C3=A9 : mercredi 7 d=C3=A9cembre 2005 16:10
=C3=80 : webtest@lists.canoo.com
Objet : Re: [Webtest] Re: AJAX (DWR) webtest Compatability


Hi Richard,

this comes from a currently incomplete implementation of XMLHttpRequest=20
in htmlunit. To be more precise the responseXML is not totally mapped to =

be accessed using the normal JS syntax. In your case it is probably the=20
nodes that can't be accessed with syntax "nodes[0]".

Marc.


Richard HALLIER wrote:
> Hi all,
>=20
> I'm using the latest 1.7 version, build number =3D R_1041.
> It is a simple ajax action (Taconite implementation), on a change of a =
combobox, another is populated depending the value selected in the first =
one.
>=20
> Here is my webtest script :
>=20
> <setselectfield name=3D"zone" optionIndex=3D"1"/>
> <sleep description=3D"pause for 5 sec" seconds=3D"5"/>  // Waiting the =
ajax rendering of the second combobox
> <clickButton description=3D"Submit the form" label=3D"${actions.add}" =
/>
>=20
> Here is the error :
>=20
>   INFO (com.canoo.webtest.steps.Step) - Start Step: setselectfield =
"<unknown>" (8/12)
>   INFO (com.canoo.webtest.engine.Context) - Current form set to =
(action=3DaddCountryToUser.html)
>   INFO (com.canoo.webtest.steps.Step) - Start Step: sleep "pause for 5 =
sec" (8/12)
>   INFO (com.canoo.webtest.extension.Sleep) - Sleeping for 5000 =
milliseconds
>   INFO (com.canoo.webtest.engine.Context) - Content of window changed =
to =
http://localhost:8080/xxx/ajax/combobox.html?targetId=3Dcountry&ts=3D1133=
965936390&zone=3D1
>   INFO (com.canoo.webtest.engine.Context) - Webclient: =
com.gargoylesoftware.htmlunit.WebClient@ba5c7a
>   INFO (com.canoo.webtest.engine.Context) - script engine: =
com.gargoylesoftware.htmlunit.javascript.JavaScriptEngine@10d593e
>   INFO (com.canoo.webtest.engine.Context) - Content of current window =
changed, it will become current response
>   INFO (com.canoo.webtest.engine.Context) - Current form set to none
>   INFO (com.canoo.webtest.engine.Context) - Changed last response to =
http://localhost:8080/xxx/ajax/combobox.html?targetId=3Dcountry&ts=3D1133=
965936390&zone=3D1
>   Exception in thread "XMLHttpRequest.send() Thread" =
org.mozilla.javascript.EvaluatorException: La classe Java =
"com.sun.org.apache.xerces.internal.dom.DeferredElementImpl" ne =
poss=C3=A8de aucun champ ou aucune m=C3=A9thode d'instance publique =
appel=C3=A9 "0" (/afvp/scripts/taconite-client.js#268)
>   at =
org.mozilla.javascript.DefaultErrorReporter.runtimeError(DefaultErrorRepo=
rter.java:95)
>   at =
org.mozilla.javascript.Context.reportRuntimeError(Context.java:966)
>   at =
org.mozilla.javascript.Context.reportRuntimeError(Context.java:1022)
>   at =
org.mozilla.javascript.Context.reportRuntimeError2(Context.java:992)
>   at =
org.mozilla.javascript.JavaMembers.reportMemberNotFound(JavaMembers.java:=
635)
>   at =
org.mozilla.javascript.NativeJavaObject.get(NativeJavaObject.java:106)
>   at =
org.mozilla.javascript.ScriptableObject.getProperty(ScriptableObject.java=
:1340)
>   at =
org.mozilla.javascript.ScriptRuntime.getObjectElem(ScriptRuntime.java:130=
1)
>   at =
org.mozilla.javascript.ScriptRuntime.getObjectElem(ScriptRuntime.java:128=
5)
>   at =
org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:2845)
>   at script(/afvp/scripts/taconite-client.js:268)
>   at script(/afvp/scripts/taconite-client.js:225)
>   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.call(InterpretedFunction.java:=
147)
>   at =
com.gargoylesoftware.htmlunit.javascript.host.XMLHttpRequest.setState(XML=
HttpRequest.java:127)
>   at =
com.gargoylesoftware.htmlunit.javascript.host.XMLHttpRequest.doSend(XMLHt=
tpRequest.java:340)
>   at =
com.gargoylesoftware.htmlunit.javascript.host.XMLHttpRequest.access$0(XML=
HttpRequest.java:323)
>   at =
com.gargoylesoftware.htmlunit.javascript.host.XMLHttpRequest$1.run(XMLHtt=
pRequest.java:302)
>   INFO (com.canoo.webtest.steps.Step) - Start Step: clickButton =
"Soumet le formulaire" (8/12)
>   INFO (com.canoo.webtest.steps.request.AbstractTargetAction) - -> =
gotoTarget by clickButton with name: null
>   INFO (com.canoo.webtest.steps.Step) - Exception thrown from this =
class: com.canoo.webtest.engine.StepExecutionException
>   INFO (com.canoo.webtest.steps.Step) - Message was: Last response is =
not an HTML page but of type text/xml
>   INFO (com.canoo.webtest.steps.Step) - Exception thrown from this =
class: com.canoo.webtest.engine.StepExecutionException
>   INFO (com.canoo.webtest.steps.Step) - Message was: Last response is =
not an HTML page but of type text/xml
>   INFO (com.canoo.webtest.steps.Step) - Exception thrown from this =
class: com.canoo.webtest.engine.StepExecutionException
>   INFO (com.canoo.webtest.steps.Step) - Message was: Last response is =
not an HTML page but of type text/xml
>   INFO (com.canoo.webtest.ant.WebtestTask) - Writing report using =
Report class: com.canoo.webtest.reporting.XmlReporter
>   INFO (com.canoo.webtest.ant.WebtestTask) - Test summary successfully =
created.
>=20
> I can point out that manually everything works perfectly, so its =
clearly a problem with canoo web test/htmlunit.
> I dont know if it's a problem of javascript support or a response =
changed to xml (response to the ajax action) ?
>=20
> Have you any pointers?
>=20
> Thank you a lot.
> Richard
>=20
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest
>=20

_______________________________________________
WebTest mailing list
WebTest@lists.canoo.com
http://lists.canoo.com/mailman/listinfo/webtest