0

My test script uses Selenium WebDriver with BrowserMob proxy server to simulate slow connection. Starting of the Internet Explorer WebDriver with BrowserMob proxy turns on system proxy. It affects to all connections to the internet (eclipse plugins update, mail corresponding and other apps). Therefore I need to disable system proxy at the end of test script. How to do this from java?

Note: stopping of BrowserMob proxy server doesn't disable system proxy settings.

1 Answer 1

0

I found solution in Internet Explorer WebDriver. There is need to start web driver with IE specific desired capabilities like this:

BrowserMobProxy server = new BrowserMobProxyServer();
server.start();

Proxy proxy = ClientUtil.createSeleniumProxy(server);

DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();
capabilities.setCapability(InternetExplorerDriver.IE_USE_PRE_PROCESS_PROXY, true);
capabilities.setCapability(CapabilityType.PROXY, proxy);

WebDriver driver = new InternetExplorerDriver(capabilities);

More info here https://github.com/SeleniumHQ/selenium/wiki/DesiredCapabilities

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.