Pages

IEDriver - How To Resolve "Enable Protected Mode For All Zones" Error RunTime

Earlier we learnt how to execute WebDriver software test In Internet Explorer browser using InternetExplorerDriver In previous post. We have also learnt how to resolved "Protected Mode settings are not the same for all zones. Enable Protected Mode must be set to the same value (enabled or disabled) for all zones." error by setting "Enable Protected Mode" check box value same

for all zones manually In Internet Explorer browser.

Manual browser setting will remain limited to your computer only means If same software test will be executed on other computer then your test will fail If IE browser's "Enable Protected Mode" settings not configured In that computer. To resolve this Issue, We need something In our software automation test script which can configure all these settings Itself on run time. Means It should handle all zones protected mode security settings Itself when you run your test script on any machine. Is It possible? Answer Is "Yes".

We can do It using DesiredCapabilities class of selenium WebDriver software testing Interface. Bellow given code will set IEDriver capability to Ignore "Enable Protected Mode" settings and will allow you to run your test without any error regardless whatever your settings are there for "Enable Protected Mode" In IE browser.

This isn't a good permanent solution as described here: http://jimevansmusic.blogspot.com.au/2012/08/youre-doing-it-wrong-protected-mode-and.html

The "Selenium Grid Extras" project looks like one solution if using Selenium Grid: http://elementalselenium.com/tips/70-grid-extrasbut to just get the feature that updates IE settings it seems like a bit of a sledgehammer solution given everything else it does.