简体   繁体   中英

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.

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 . The latest Capybara (2.15.1) release provides a default registration for :selenium_chrome which is defined as

# 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 ).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM