所以,我正在使用 -
gem 'watir-webdriver', '0.5.4'
gem 'selenium-webdriver', '2.21.1'
和 JRuby - 1.6.5
我想做的就是打开IE。我有 IE 版本 8。
>> require "rubygems"
=> true
?> require "watir-webdriver"
=> true
?> @b = Watir::Browser.new :ie
Selenium::WebDriver::Error::UnhandledAlertError: Modal dialog present
from C:/jruby-1.6.5/lib/ruby/gems/1.8/gems/selenium-webdriver-2.21.2/lib/selenium/webdriver/remote/response.rb:52:in `assert_ok'
from C:/jruby-1.6.5/lib/ruby/gems/1.8/gems/selenium-webdriver-2.21.2/lib/selenium/webdriver/remote/response.rb:15:in `initialize'
from C:/jruby-1.6.5/lib/ruby/gems/1.8/gems/selenium-webdriver-2.21.2/lib/selenium/webdriver/remote/http/common.rb:59:in `create_response'
from C:/jruby-1.6.5/lib/ruby/gems/1.8/gems/selenium-webdriver-2.21.2/lib/selenium/webdriver/remote/http/default.rb:64:in `request'
from C:/jruby-1.6.5/lib/ruby/gems/1.8/gems/selenium-webdriver-2.21.2/lib/selenium/webdriver/remote/http/default.rb:62:in `request'
from C:/jruby-1.6.5/lib/ruby/gems/1.8/gems/selenium-webdriver-2.21.2/lib/selenium/webdriver/remote/http/common.rb:40:in `call'
from C:/jruby-1.6.5/lib/ruby/gems/1.8/gems/selenium-webdriver-2.21.2/lib/selenium/webdriver/remote/bridge.rb:598:in `raw_execute'
from C:/jruby-1.6.5/lib/ruby/gems/1.8/gems/selenium-webdriver-2.21.2/lib/selenium/webdriver/remote/bridge.rb:92:in `create_session'
from C:/jruby-1.6.5/lib/ruby/gems/1.8/gems/selenium-webdriver-2.21.2/lib/selenium/webdriver/remote/bridge.rb:68:in `initialize'
from C:/jruby-1.6.5/lib/ruby/gems/1.8/gems/selenium-webdriver-2.21.2/lib/selenium/webdriver/ie/bridge.rb:40:in `initialize'
from C:/jruby-1.6.5/lib/ruby/gems/1.8/gems/selenium-webdriver-2.21.2/lib/selenium/webdriver/common/driver.rb:35:in `for'
from C:/jruby-1.6.5/lib/ruby/gems/1.8/gems/selenium-webdriver-2.21.2/lib/selenium/webdriver.rb:63:in `for'
from C:/jruby-1.6.5/lib/ruby/gems/1.8/gems/watir-webdriver-0.5.8/lib/watir-webdriver/browser.rb:35:in `initialize'
from (irb):5:in `evaluate'
from C:/jruby-1.6.5/lib/ruby/1.8/irb.rb:158:in `eval_input'
from C:/jruby-1.6.5/lib/ruby/1.8/irb.rb:271:in `signal_status'
from C:/jruby-1.6.5/lib/ruby/1.8/irb.rb:155:in `eval_input'
from C:/jruby-1.6.5/lib/ruby/1.8/irb.rb:154:in `eval_input'
from C:/jruby-1.6.5/lib/ruby/1.8/irb.rb:71:in `start'
from C:/jruby-1.6.5/lib/ruby/1.8/irb.rb:70:in `catch'
from C:/jruby-1.6.5/lib/ruby/1.8/irb.rb:70:in `start'
from C:/jruby-1.6.5/bin/jirb:13:in `(root)'
from -e:1:in `load'
from -e:1:in `(root)'>>
IE webdriver 被打开,但出现上述错误。
当我使用任何其他浏览器(firefox 或 chrome)时,它们会按照应有的方式打开。它从本周开始发生。我的意思是我多年来一直在使用 selenium-webdriver,并且在打开 IE 或任何浏览器时从来没有遇到过问题。错误说有一个模态对话框,但是我刚打开IE怎么会有模态对话框,打开IE webdriver时看不到任何对话框。如果是这样,为什么其他浏览器不抱怨?
我假设它可能需要与公司笔记本电脑上推送的某些 Windows 或安全更新有关,但我只是想看看其他人以前是否遇到过这种情况以及解决方案是什么?