问题
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