Problem running watir-webdriver on Windows 7 with IE9
Asked Answered
I

2

5

I'm trying to use watir-webdriver with IE9 on 64bit Windows 7. When I try to open a new browser I am getting the following error message, any ideas on a solution?

C:\watir>irb
irb(main):001:0> require "rubygems"
=> true
irb(main):002:0> require "watir-webdriver"
=> true
irb(main):003:0> browser = Watir::Browser.new(:ie)
Selenium::WebDriver::Error::NoSuchDriverError: Unexpected error launching Internet Explorer. Protected Mode must be set to the same value (enabled or disabled) for all zones.

I can use watir-webdriver on the same machine okay with Firefox 4, so I'm guess either its and IE9 issue?

Intersection answered 23/6, 2011 at 12:32 Comment(0)
R
5

Did you try disabling protected mode as the error message tells you ?

Tools >> Options >> Security >> Untick 'Enable Protected Mode'

This thread on selenium-developers group is relevant to the restrictions with protected mode: http://groups.google.com/group/selenium-developers/browse_thread/thread/4dd6330f97bd2312/3e904642ac3dac6?q

Also relevant a link to the Watir FAQ.

Try one of these:

  • Add your defaut homepage (or 'About:Blank' if you start with a blank page) to the same security group (e.g. 'intranet' or ''trusted sites') as the site you are testing; or
  • Turn off Internet Explorer Protected Mode; or
  • Change your ruby permissions to "run as administrator"; or
  • Disable User Access Control
Rugged answered 23/6, 2011 at 12:35 Comment(2)
Thanks I've just checked at it had been switched on for trusted sites only. Unchecked it and it is launching now, thanks.Intersection
For anyone else having issues with Watir + IE: I was getting a NoSuchWindowError (instead of a NoSuchDriverError). I'm using Windows 7 x64, Internet Explorer 9, the selenium-webdriver gem v 2.29.0 and IEDriverServer 2.30.1.0. Adding the URL being tested to the trusted sites fixed this error too.Speculative
P
3

I had same issue, but I have fixed it within the Automation script by setting IE Capabilities. We can change protected mode settings within the script, before launching the browser. You can try the below code:

caps = Selenium::WebDriver::Remote::Capabilities.ie(:ignoreProtectedModeSettings => true)
driver = Watir::Browser.new  :ie, :desired_capabilities => caps
Plascencia answered 17/5, 2015 at 20:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.