To see all of the available configuration in Firefox simply type "about:config" on the firefox address bar. You will then see the following screen:
One solution is to set the browser profile to use a proxy setting. The code can be placed inside the env.rb files to override the anonymous browser profile that Capybara uses.
# Need to override the driver to setup our proxy profile class Capybara::Driver::Selenium def self.driver unless @driver profile = Selenium::WebDriver::Firefox::Profile.new profile["network.proxy.type"] = 1 profile["network.proxy.http"] = "proxy setting" profile["network.proxy.http_port"] = 8080 @driver = Selenium::WebDriver.for(:firefox, :profile => profile) at_exit do @driver.quit end end @driver end end
If you need to use the Automatic proxy configuration (pac file) URL then you would need to add the following line:
And change the network.proxy.type into 2
profile["network.proxy.type"] = 1
If you need Capybara to use a different browser other than Firefox you can change the webdriver browser's profile. To change the default profile for other browsers you just need to change the @driver to use the browser that you want.
@driver = Selenium::WebDriver.for :ie or @driver = Selenium::WebDriver.for :chrome
Please note that webdriver currently only supports Firefox, IE and chrome.