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?
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
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
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