我使用最新的selenium-webdriver(2.47.1)和watir-webdriver(0.8.0)并将Edge WebDriver安装在Ruby / bin文件夹中,就像其他webdriver.exe文件一样;像chromedriver或iedriver。它似乎启动了Edge浏览器,但在关闭浏览器并且未通过所有测试之前不会尝试转到URL。我在Windows中的防火墙允许它,当我运行我的rspec测试时它说:
Selenium::WebDriver::Error::NoSuchWindowError: no such window
有没有人让MSWebdriver使用watir-webdriver?
错误:
c:/Ruby-222-x64/lib/ruby/gems/2.2.0/gems/selenium-webdriver-2.47.1/lib/selenium/webdriver/remote/response.rb:71:in `assert_ok': not implemented (Selenium::WebDriver::Error::WebDriverError)
from c:/Ruby-222-x64/lib/ruby/gems/2.2.0/gems/selenium-webdriver-2.47.1/lib/selenium/webdriver/remote/response.rb:34:in `initialize'
from c:/Ruby-222-x64/lib/ruby/gems/2.2.0/gems/selenium-webdriver-2.47.1/lib/selenium/webdriver/remote/http/common.rb:78:in `new'
from c:/Ruby-222-x64/lib/ruby/gems/2.2.0/gems/selenium-webdriver-2.47.1/lib/selenium/webdriver/remote/http/common.rb:78:in `create_response'
from c:/Ruby-222-x64/lib/ruby/gems/2.2.0/gems/selenium-webdriver-2.47.1/lib/selenium/webdriver/remote/http/default.rb:90:in `request'
from c:/Ruby-222-x64/lib/ruby/gems/2.2.0/gems/selenium-webdriver-2.47.1/lib/selenium/webdriver/remote/http/common.rb:59:in `call'
from c:/Ruby-222-x64/lib/ruby/gems/2.2.0/gems/selenium-webdriver-2.47.1/lib/selenium/webdriver/remote/bridge.rb:657:in `raw_execute'
from c:/Ruby-222-x64/lib/ruby/gems/2.2.0/gems/selenium-webdriver-2.47.1/lib/selenium/webdriver/remote/bridge.rb:635:in `execute'
from c:/Ruby-222-x64/lib/ruby/gems/2.2.0/gems/selenium-webdriver-2.47.1/lib/selenium/webdriver/remote/bridge.rb:221:in `switchToDefaultContent'
from c:/Ruby-222-x64/lib/ruby/gems/2.2.0/gems/selenium-webdriver-2.47.1/lib/selenium/webdriver/common/target_locator.rb:96:in `default_content'
from c:/Ruby-222-x64/lib/ruby/gems/2.2.0/gems/watir-webdriver-0.8.0/lib/watir-webdriver/browser.rb:385:in `assert_exists'
from c:/Ruby-222-x64/lib/ruby/gems/2.2.0/gems/watir-webdriver-0.8.0/lib/watir-webdriver/browser.rb:110:in `url'
from c:/Ruby-222-x64/lib/ruby/gems/2.2.0/gems/watir-webdriver-0.8.0/lib/watir-webdriver/browser.rb:79:in `goto'
from msedge.rb:4:in `<main>'
此外,IE按预期工作。
答案 0 :(得分:1)
看起来这个问题已经变得很老了,但如果有人还在寻找答案,让我试着回答......
使用MSWebdriver for MSEdge时要考虑以下几点
1)仅为您的操作系统构建下载驱动程序,其他MSWebDriver不起作用 如何检查您的Windows 10操作系统版本? 打开运行(Win + R)并键入winver
2)下载正确的版本后,将其放在PATH变量中的任何文件夹中或将其放在某处并将该位置添加到PATH变量
3)现在正常运行测试并适当初始化边缘浏览器 例如:ruby-webdriver:driver = Selenium :: WebDriver.for:edge
希望这有帮助!! 快乐自动化!!
答案 1 :(得分:0)
仅供参考 - 我已经能够使用此配置在Windows 10上使用Edge浏览器:
然后:
请注意,服务器在启动新的Edge浏览器对象时启动,但如果浏览器意外终止,则可能会挂起。在这种情况下,在Edge浏览器的另一个实例能够与服务器通信之前,需要使用Windows任务管理器手动终止服务器。