Hi, currently the proxy settings have to be provided at construction time of an HtmlUnit's WebClient and can't be changed afterwards. There is already a feature request for that in HtmlUnit: [ 1900452 ] API for runtime proxy change http://sourceforge.net/tracker/index.php?func=detail&aid=1900452&group_id=47038&atid=448269
once this is implemented, it will be possible to handle your use case (but rather programmitacally than with setproxy becauses this last one just set some system properties that should be checked before each step). Cheers, Marc. -- Blog: http://mguillem.wordpress.com George Policello wrote: > The following gets the page just fine but it fails on the > <then> <setproxy proxyhost='' /> > 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) > > ======================================================================== > 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. > ======================================================================== > BACKGROUND: > All the <options> mentioned in the manual text > http://webtest.canoo.com/webtest/manual/option.html > are set to "false". > > Why? > The <setproxy proxyhost='' /> 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 > ======================================================================== > CODE: > <setproxy proxyhost='${zeligURL}' proxyport='${zeligPort}' /> > > <ifStep description='Try the invoke and if fails go to next step.' > > <condition> > <invoke url="http://${URL}" description="http://${URL}" /> > </condition> > <then> > <setproxy proxyhost='' /> <!-- FAILS HERE --> > <verifyTitle text="${Title}" /> > </then> > <else> > <setproxy proxyhost='' /> > </else> > </ifStep> > ======================================================================== > > 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 > _______________________________________________ > WebTest mailing list > [email protected] > http://lists.canoo.com/mailman/listinfo/webtest > _______________________________________________ WebTest mailing list [email protected] http://lists.canoo.com/mailman/listinfo/webtest

