0

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?

Xavier Dury
  • 1,530
  • 1
  • 16
  • 23

1 Answers1

0
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`
user1307037
  • 419
  • 3
  • 5
  • It does not work for me, JWebUnit uses HTMLUnit which uses HTTPClient which does not seem to use any proxy(Host|Port) given in the system properties. – Xavier Dury Apr 10 '12 at 10:25
  • here is a link to the HTMLUnit API which will show you the com.gargoylesoftware.htmlunit.ProxyConfig http://htmlunit.sourceforge.net/apidocs/com/gargoylesoftware/htmlunit/ProxyConfig.html – user1307037 Apr 11 '12 at 03:26