[Webtest] Stream closed

Peter Anning webtest@lists.canoo.com
Fri, 6 Oct 2006 06:26:16 +1000


I guess your page is making AJAX calls? If the header "HTP1.1 200 OK" is
not the issue then it could be a question of timing. We have had
problems where if the AJAX call has not happened and the page unloads or
something then we'd see XMLHttpRequest errors.

Putting a sleep statement before the step that gives the error sorted
the problem:

<!--=20
wait for AJAX depending on how slow your server is or how fast you test
cleint machine is=20
You may need to increase this value
-->
<sleep description=3D"wait 1 sec for AJAX" seconds=3D"1"/>
<!-- now perform AJAX dependent step
<setSelectField name=3D"Choose destination" value=3D"(6/7)"/>


>  Stefanie Wilms wrote

>=20
>=20
> Hi,
>=20
> can anyone help me with the following error?
> com.canoo.webtest.engine.StepFailedException:=20
> Step[setSelectField "Choose destination" (6/7)]: Script error=20
> loading page executing webtest at: setSelectField Wrapped=20
> java.io.IOException: Stream closed=20
> (http://localhost:8080/tra/javascript/traFunctions.js#6)=20
> Source code: function () { [native code, arity=3D0] }=20
>=20
> [setSelectField] Exception in thread "HtmlUnit Managed Thread=20
> #1" org.mozilla.javascript.EvaluatorException: Unable to send=20
> the XMLHttpRequest: java.io.IOException: Unable to parse=20
> header: HTP/1.1 200    OK
> [setSelectField]        at=20
> org.mozilla.javascript.DefaultErrorReporter.runtimeError(Defau
> ltErrorReporter.java:95)
> [setSelectField]        at=20
> org.mozilla.javascript.Context.reportRuntimeError(Context.java:966)
> [setSelectField]        at=20
> org.mozilla.javascript.Context.reportRuntimeError(Context.java:1022)
> [setSelectField]        at=20
> com.gargoylesoftware.htmlunit.javascript.host.XMLHttpRequest.d
> oSend(XMLHttpRequest.java:348)
> [setSelectField]        at=20
> com.gargoylesoftware.htmlunit.javascript.host.XMLHttpRequest.a
> ccess$000(XMLHttpRequest.java:68)
> [setSelectField]        at=20
> com.gargoylesoftware.htmlunit.javascript.host.XMLHttpRequest$1
> .run(XMLHttpRequest.java:307)
> [setSelectField]        at java.lang.Thread.run(Unknown Source)
> [setSelectField]        at=20
> com.gargoylesoftware.htmlunit.ThreadManager$1.run(ThreadManage
> r.java:101)
> [setSelectField]=20
> org.apache.commons.httpclient.ProtocolException: The server=20
> localhost failed to respond with a valid HTTP response
>=20
>=20
> Stefanie
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com=20
> http://lists.canoo.com/mailman/listinfo/webtest
>=20