My code in Visual studio is using selenium webdriver 2.24.0. My testing framework I'm using is Nunit. My code worked just fine(loading diff. browsers, driving the websites) until version 2.24.0 was released.
I added the new IE standalone server to my project.
Now whenever I run my code NUnit encounters this error message.
FirstSeleniumTest.SeleniumTest.TestGoogle:
SetUp : System.InvalidOperationException : Unexpected error launching Internet Explorer. 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. (NoSuchDriver)
TearDown : System.NullReferenceException : Object reference not set to an instance of an object.
Then Command prompt pops up with this.
Started InternetExplorerDriver server (64-bit)
2.24.0.0
Listening on port 50329
I disabled protected mode on my IE. Still no luck.
How can I get my code back to proper webdriving?
On the menu bar, click the Tools button and then click Internet Options. In the Internet Options window, click on the Security tab. On the Security tab, in the Security level for this zone section, click to check the box next to Enable Protected Mode (requires restarting Internet Explorer) to enable protected mode.
You should ensure, that protected mode is either enabled or disabled for all 4 security zones (Internet, Local intranet, Trusted sites, Restricted sites). In other words, the setting value should be the same for all security zones.
Just to add to the already correct answers, if setting all values the same is not an option, (Need security disabled is some zones, but want to keep security enabled in others) you can also initialize your driver with the overload that includes InternetExplorerOptions
, and use
new InternetExplorerOptions() { IntroduceInstabilityByIgnoringProtectedModeSettings = true}
You need to set the Protected Mode settings for each zone to be the same value. Read: http://code.google.com/p/selenium/wiki/InternetExplorerDriver#Required_Configuration
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With