A simple Google Chrome extension to set request headers for test automation
If you're using Chrome driver and need to set custom headers for your scripts.
Load this extension along with your driver:
# .rb
Capybara.register_driver :selenium do |app|
options = Selenium::WebDriver::Chrome::Options.new(extensions: ['extension.crx'])
Capybara::Selenium::Driver.new(app, :browser => :chrome, options: options)
end
For now you'll need to edit background.js:
/*javascript*/
var headers = details.requestHeaders, blockingResponse = {};
headers.push( {name: 'X-Custom-Header', value: 'x-custom-value'} );