为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设置代理)_第1张图片

 

你可能感兴趣的:(webdriver)