[Webtest] <setproxy ... /> fails inside <then> ?
George Policello
George Policello" <gpolicello@mmetrics.com
Thu, 27 Mar 2008 15:58:47 -0700
The following gets the page just fine but it fails on the
<then> <setproxy proxyhost=3D'' />
with
Unexpected exception caught: org.apache.tools.ant.BuildException
The stack trace did not help much.
SECTIONS BELOW
* GOAL (what I really want to do any way I can)
* BACKGROUND
* CODE (current idea that fails)
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
GOAL:
The goal is to get passed any URL for which the <invoke ... /> fails
for a reason other than those covered by the <config ...><option>
capabilities.
For example, Timeout, Connection, or
"Unexpected exception caught: java.net.SocketException"
errors.
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
BACKGROUND:
All the <options> mentioned in the manual text
http://webtest.canoo.com/webtest/manual/option.html=20
are set to "false".
Why?
The <setproxy proxyhost=3D'' /> is needed before moving on or the
next step gets an UnknownHostException.
Basically, used example 2 of ifStep as an example
http://webtest.canoo.com/webtest/manual/ifStep.html
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
CODE:
<setproxy proxyhost=3D'${zeligURL}' proxyport=3D'${zeligPort}' />
<ifStep description=3D'Try the invoke and if fails go to next step.' >
<condition>
<invoke url=3D"http://${URL}" description=3D"http://${URL}" />
</condition>
<then>
<setproxy proxyhost=3D'' /> <!-- FAILS HERE -->
<verifyTitle text=3D"${Title}" />
</then>
<else>
<setproxy proxyhost=3D'' />
</else>
</ifStep>
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
Has anyone seen something similar before? Any suggestions would be
welcome.
Even a different way to deal with the Goal instead of the existing code.
Thanks,
George