为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);

效果:

为WebDriver 设置proxy(IE设置代理)

上一篇:win7+win10系统使用日常经验集锦


下一篇:Xss过滤,只json型数据过滤,图片文件不过滤,采用jsoup