我使用JWebUnit在本地运行的应用程序上运行测试(本地主机),但是我的应用程序的某些部分需要将用户重定向到外部站点,然后再返回(重定向到本地主机)。
因为我在代理后面,所以我尝试使用TestContext.setProxyAuthorization(),但是JWebUnit不能在本地访问应用程序(TestContext与nonProxyHosts完全不同),如果我不使用TestContext.setProxyAuthorization(),JWebUnit就不能访问远程站点。
我该怎么办?
发布于 2012-04-02 17:38:13
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`https://stackoverflow.com/questions/9818815
复制相似问题