Desired capabilities Webdriver – Ignore security in browser

Hello again, I had some codes to show you !

Like this one, when you have some problem with the certificate page, or proxy, or another security problem, you can put this code for initialise the webdriver. Before you code anything, you have to start the webdriver and config this one, you can use this config for start the webdriver with the config of all security is off.

In this example I use the IE 9 and platform windows like the default browser:

DesiredCapabilities capabilities = new DesiredCapabilities(“Internet Explorer”, “9”, Platform.WINDOWS);
capabilities.setJavascriptEnabled(true);
capabilities.setCapability(“ignoreProtectedModeSettings”, true);
capabilities.setCapability(“ensureCleanSession”, true);
capabilities.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
WebDriver driver = new InternetExplorerDriver(capabilities);

 

Bye bye !!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.