[英]Capybara.current_driver = :chrome versus :selenium_chrome
what are the advantages/pros/cons of using 使用的优点/优点/缺点是什么
Capybara.current_driver = :chrome
versus using 与使用
Capybara.current_driver = :selenium_chrome
To give a bit more context, I'm using capybara in a standalone ruby script. 为了提供更多背景信息,我在一个独立的ruby脚本中使用了capybara。
They are just names that can be used to identify specific driver configurations so it all depends on what is registered as :chrome
and :selenium_chrome
. 它们只是可用于标识特定驱动程序配置的名称,因此这完全取决于注册为:chrome
和:selenium_chrome
。 The latest Capybara (2.15.1) release provides a default registration for :selenium_chrome
which is defined as 最新的Capybara(2.15.1)版本提供了:selenium_chrome
的默认注册,定义为:
# Configure selenium-webdriver to use chrome as the browser
Capybara.register_driver :selenium_chrome do |app|
Capybara::Selenium::Driver.new(app, :browser => :chrome)
end
but that can be redefined in your code. 但是可以在您的代码中重新定义。 There is no gem, that I know of, that provides a default registration of :chrome
so if that's currently valid it would most likely be defined in your code (search for register_driver
). 据我所知,没有一个提供默认注册的:chrome
宝石,因此如果当前有效,它很可能会在您的代码中定义(搜索register_driver
)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.