Marc,

thank you for the response. I probably did not explain the issue (or
sub-issue) as well as I wanted to.

If I remove the <ifStep> and its related tags (<condition><then><else>)
and leave just the <invoke> and the <setproxy proxyhost=''> lines, it
works just fine as long as the <invoke> step works. Inside the <ifStep>
code, the <then> part is responding to the <invoke> working, for that
condition (analogous to the code without <ifStep>) the <setproxy
proxyhost=''> does not work.

Since the sequence works, last paragraph, with no <ifStep> but not
inside an <ifStep> it would help to know what the "Construction" time is
or relates to so I could build a work around. That is, why does it work
when there is no <ifStep> but not when there is an <ifStep>?

I looked at the Ant SetProxy class and mimicked its code in my Groovy
procedures; that did not work but I almost expected that. Setting the
"sysprops" Map entries just seemed too easy to work.

Thanks and have a great weekend,
George
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Marc Guillemot
Sent: Friday, March 28, 2008 1:00 AM
To: [email protected]
Subject: Re: [Webtest] <setproxy ... /> fails inside <then> ?

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_i
d=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
_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest

Reply via email to