I have a problem in setting a proxy config in webtester. Before, with htmlunit 2.11 jar I was using the following code:
HtmlUnitTestingEngineImpl h = (HtmlUnitTestingEngineImpl) wt.getTestingEngine();
ProxyConfig proxyConfig = new ProxyConfig(ip, 4128);
h.getWebClient().setProxyConfig(proxyConfig);
After updating jwebunit libraries (i.e. htmlunit 2.13, httpclient4.3.1 etc.) the setProxyConfig method isn't supported in WebClient. It seems the only way to set proxy in WebClient is in the constructor. Now, How can I set a proxy configuration for a jwebunit WebTester? Thanks
You can use
buy pay attention to set the proxyauthorization BEFORE webtester.beginAt(..)
In the beginAt method happens the webclient init with proxy parameter. After beginAt the webclient is reused so the first code (setProxyAuthorization) can't affect the webclient.