Using JWebUnit behind a proxy

430 Views Asked by At

I'm using JWebUnit to run tests on my application running locally (localhost) but some parts of my application require the user to be redirected to an external site, do some stuff then come back (redirected to localhost).

As I'm behind a proxy, I've tried using TestContext.setProxyAuthorization() but then JWebUnit can't access the application locally (TestContext has nothing like nonProxyHosts) and if I don't use TestContext.setProxyAuthorization(), JWebUnit can't access the remote site.

What should I do?

1

There are 1 best solutions below

2
On
you can use the following within your setup method.  I have used this myself and it works
you may need to add a password key and a value too

 System.setProperty("proxyHost", "AUT ip");
 System.setProperty("proxyPort", "AUT port 8080");
 System.setProperty("proxySet", "true");
 System.setProperty("http.nonProxyHosts", "webserverfor AUT");`enter code here`