Cucumber 刚刚打开IE的selenium webdriver错误

Cucumber 刚刚打开IE的selenium webdriver错误,cucumber,selenium-webdriver,irb,Cucumber,Selenium Webdriver,Irb,因此,我使用- 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::Err

因此,我使用-

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——时,它们只是按预期的方式打开。这件事从本周开始就发生了。我的意思是,我已经使用SeleniumWebDriver多年了,在打开IE或任何浏览器时从来没有遇到过问题。Error说有一个模态对话框,但当我刚刚打开IE时怎么会有模态对话框,而当IE webdriver打开时我却看不到任何对话框。如果是这样,为什么其他浏览器不抱怨呢


我假设这可能需要一些windows或公司笔记本电脑上的安全更新,但我只想看看是否有其他人以前遇到过这种情况,解决方案是什么?

我可以想到两种可能性。一个是,当您试图执行测试时,您打开了Windows任务管理器。IE驱动程序的早期版本中存在一个bug,如果任务管理器在使用IE驱动程序运行代码时处于打开状态,该bug可能会不正确地引发意外AlertException

第二个选项是浏览器插件,它在内部创建一个对话框窗口,但将其隐藏。有许多针对IE的防病毒和其他反恶意软件插件可能会导致此问题


在任何一种情况下,都要更新到a,看看这是否解决了问题。

好的,找到了解决方案。这是反病毒的东西。问题是-当您使用IE运行脚本时,McAfee site adviser模态窗口位于IE浏览器的顶部,因此我们无法访问IE浏览器甚至无法打开它。这是IE特有的,因为IE是我工作场所的“默认”和“首选”浏览器


McAfee提供了两个dll文件,并将它们复制粘贴到某个特定位置解决了此问题。对不起,我在这个问题上用了你们所有的心思,虽然它与硒无关,但是mcafee的问题。关闭问题。

在IE中打开一个空白窗口,您是否看到对话框或类似的内容?通常它表示selenium在“自然”浏览器状态下检测到一些不符合要求的内容