cuprite
cuprite copied to clipboard
Improve documentation on user agent strings
In our test suite, we also test with mobile user agents. We do this by creating several different drivers with different user agents. Coming from Selenium, I was used to set the user agent in the browser options. With no mention of the user-agent option in the Ferrum or Cuprite documentation, I assumed we needed to use headers:
driver = Capybara::Cuprite::Driver.new(app)
driver.add_header("User-Agent", "...")
This works fine for the first request in the driver, but subsequent requests fail due to the reset of the headers. I found out the user-agent browser option still works fine. I think it is worth a mention in the README so other developers also know how to set the right user-agent string for their drivers.
This sounds like a bug, it shouldn't be like that