如何通过 Capybara env.rb 将 chromedriver 设置为在没有任何扩展的情况下运行?
这是我的 env.rb
require 'capybara'
require 'capybara/cucumber'
require 'rspec'
require 'selenium/webdriver'
#require 'capybara/rails'
caps = Selenium::WebDriver::Remote::Capabilities.chrome #chrome|firefox
caps.version = "8"
caps.platform = :WINDOWS
Capybara.server_port = 3001
Capybara.app_host = "http://www.google.com"
Capybara.default_driver = :selenium
Capybara.ignore_hidden_elements = false
Capybara.register_driver :selenium do |app|
Capybara::Selenium::Driver.new(app,
:browser => :chrome #chrome|firefox
#,
#:url => "localhost:4444/wd/hub",
#:desired_capabilities => caps
)
end
提前感谢您的帮助!