0

I want to launch IE using ruby and Selenium. I want to ignore protected mode settings.

The IE Version is 11.904 Ruby version: 2.4.5

Selenium::WebDriver::IE.driver_path = 'C:\drivers\IEDriverServer.exe' caps = Selenium::WebDriver::Remote::Capabilities.internet_explorer('ignoreProtectedModeSettings' => true) driver = Selenium::WebDriver.for(:internet_explorer, :desired_capabilities => caps) driver.get("https://www.google.com")

I expect IE to launch without any error But I am getting below error:

C:/Ruby24/lib/ruby/gems/2.4.0/gems/selenium-webdriver-3.141.0/lib/selenium/webdriver/remote/response.rb:69:in `assert_ok': 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. (Selenium::WebDriver::Error::SessionNotCreatedError)

Yadu
  • 5
  • 3

1 Answers1

1

I don't think you can do this from Selenium. After all the protected mode of IE is there to protect against this.

What I did when I had similar problem:

Open IE manually, manually set the protected mode to "Off", and set all the security zones to one and the same level (preferably the low or medium).

After that IE remembers these settings, and you can successfully use it with Selenium.

tadman
  • 208,517
  • 23
  • 234
  • 262
Jeni
  • 1,088
  • 12
  • 30