New Microsoft Edge and Selenium web driver

偶尔善良 提交于 2021-02-11 14:48:05

问题


I am a student and I started writing my first scripts using Ruby, Capybara, rspec and selenium web driver.

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.

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 is just a fork of Chromium project, so... Is it possible this browser in my tests?


回答1:


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



来源:https://stackoverflow.com/questions/61872618/new-microsoft-edge-and-selenium-web-driver

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!