为WebDriver 设置proxy(IE设置代理)
IE driver
String PROXY = "http://proxy:8083"; org.openqa.selenium.Proxy proxy = new org.openqa.selenium.Proxy(); proxy.setHttpProxy(PROXY) .setFtpProxy(PROXY) .setSslProxy(PROXY); DesiredCapabilities ds = DesiredCapabilities.internetExplorer(); ds.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true); ds.setCapability("ignoreProtectedModeSettings", true); ds.setCapability(CapabilityType.PROXY, proxy); WebDriver driver = new InternetExplorerDriver(ds);
效果:
转载请注明出处:http://www.cnblogs.com/tobecrazy/