【问题标题】:New Microsoft Edge and Selenium web driver新的 Microsoft Edge 和 Selenium Web 驱动程序
【发布时间】:2020-05-18 15:04:11
【问题描述】:

我是一名学生,我开始使用 Ruby、Capybara、rspec 和 selenium Web 驱动程序编写我的第一个脚本。

我需要在所有现代浏览器中运行我的脚本,但在新的 Microsoft 浏览器 Edge 上运行我的脚本时遇到了一些问题。

我的 rspec 配置是这样的:

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 项目的一个分支,所以......我的测试中是否有可能使用这个浏览器?

【问题讨论】:

    标签: selenium selenium-webdriver fork capybara chromium


    【解决方案1】:

    要将基于 chrome 的 Edge 与 selenium 一起使用,您需要使用最新的 selenium-webdriver 4.x alpha 版本。然后您需要注册自己的驱动程序,指定相关选项和浏览器为:edge_chrome。必要的驱动程序注册将类似于 Capybara 为 Chrome 提供的一个 - https://github.com/teamcapybara/capybara/blob/master/lib/capybara/registrations/drivers.rb#L18

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-09-30
      • 2017-09-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-04-15
      相关资源
      最近更新 更多