[Webtest] Re: AJAX (DWR) webtest Compatability

Richard HALLIER webtest@lists.canoo.com
Wed, 7 Dec 2005 15:45:18 +0100


Hi all,

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.

Here is my webtest script :

<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}" />

Here is the error :

  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.

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) ?

Have you any pointers?

Thank you a lot.
Richard