-->

instantiate capybara browser and set a proxy

2019-07-25 00:40发布

问题:

Following this documentation I'm trying to instantiate a capybara browser and set a proxy

b = Capybara::Driver::Webkit::Browser.new
b.set_proxy :host => 'localhost', :port => 8888

Unfortunately the documentation is out of date and I can't find the new right way to do it. I get:

NameError: uninitialized constant Capybara::Driver::Webkit::Browser

回答1:

page.driver.browser.set_proxy :host => 'localhost', :port => 8888