[Webtest] Proxy authentication

webtest@lists.canoo.com webtest@lists.canoo.com
Mon, 11 Apr 2005 09:01:24 -0500


Hi

I am using webtest-1.7-R_751.  My webtest needs to authenticate with
username/password to an internal proxy to get at the app it's testing.  From
the list archives and limited analysis I've done it looks like:

1. ant's (optional) `setproxy` task does not seem to allow me to do this- it
sets up system properties that are used by the jdk's java.net
Http(s)URLConnection classes, whereas these system properties do not seem to be
used by httpclient (webtest->htmlunit->httpclient.)
2. I can't see any configuration options for this is in webtest itself, or
direct support in the source code. In the code a new htmlunit WebClient()
instance is created in the Setup step, but i can't see a call anywhere to
`setCredentials` on the WebClient.

For now I've worked my way through this by a writing a webtest extension step
that sets credentials on the WebClient instance, i invoke the step before any
others in the testSpec. If someone knows of an easier solution to this I would
appreciate the help (I'm probably overlooking something easier.)
Alternatively, if there is no in built support, is this something worth
building into webtest (albeit in a more robust way than i have done) ? I'd be
happy to help out in this regard if so.

Thanks
-- Paul Devine