Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Internet Explorer protected mode error

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?

like image 490
lbrown Avatar asked Jun 20 '12 14:06

lbrown


People also ask

How do I enable IE protected mode?

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.


3 Answers

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.

like image 170
Alex Balabanov Avatar answered Nov 08 '22 23:11

Alex Balabanov


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}
like image 29
JHixson Avatar answered Nov 08 '22 22:11

JHixson


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

like image 6
Shama Avatar answered Nov 08 '22 22:11

Shama