新的Microsoft Edge和Selenium Web驱动程序 [英] New Microsoft Edge and Selenium web driver
问题描述
我是一名学生,我开始使用Ruby,Capybara,rspec和Selenium Web驱动程序编写第一个脚本.
I am a student and I started writing my first scripts using Ruby, Capybara, rspec and selenium web driver.
我需要在所有现代浏览器中运行脚本,但是在新的Microsoft浏览器Edge上运行脚本时遇到了一些问题.
I need to run my script in all modern browsers, but I'm facing some problems to run my script at the new Microsoft browser Edge.
我的rspec配置是这样的:
My rspec config is something like this:
Capybara.configure do |config|
config.default_driver = :selenium #This line is for run tests using Mozilla Firefox
#config.default_driver = :selenium_chrome #This line is for run tests using Google Chrome
end
Edge只是Chromium项目的一个分支,所以...我的测试中可能使用该浏览器吗?
Edge is just a fork of Chromium project, so... Is it possible this browser in my tests?
推荐答案
将基于chrome的Edge与硒一起使用您需要使用最新的selenium-webdriver 4.x alpha版本.然后,您需要注册自己的驱动程序,并指定相关选项和浏览器为:edge_chrome
.必要的驱动程序注册类似于Capybara为Chrome提供的注册- https://github.com/teamcapybara/capybara/blob/master/lib/capybara/registrations/drivers.rb#L18
To use chrome based Edge with selenium You need to be using the latest selenium-webdriver 4.x alpha release. Then you'd need to register your own driver specifying the relevant options and browser as :edge_chrome
. The necessary driver registration would be similar to the one Capybara provides for Chrome - https://github.com/teamcapybara/capybara/blob/master/lib/capybara/registrations/drivers.rb#L18
这篇关于新的Microsoft Edge和Selenium Web驱动程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!