Posted over 8 years ago. Visible to the public. Linked content.

Configuring User Agents with Capybara + Selenium Webdriver

A while ago we were working on an application that had an entire version specially created for mobiles, such as the iPhone. This specific application was entirely tested with Capybara, Steak and Selenium Webdriver. Although the test suite wasn’t the fastest one in the world, the web application was very well tested, and to guarantee that we would also be testing the mobile version, we would have to simulate an iPhone user agent accessing the application.

But wait, you might be thinking that we are not able to change browser headers while dealing with Selenium. Capybara has a nice API to define new drivers and Selenium allows us to define different profiles with custom configurations for each driver.

makandra has been working exclusively with Ruby on Rails since 2007. Our laser focus on a single technology has made us a leader in this space.

Owner of this card:

Avatar
Lexy
Last edit:
over 8 years ago
Keywords:
capybara, selenium, testing, makandra
About this deck:
We are makandra and do test-driven, agile Ruby on Rails software development.
License for source code
Posted by Lexy to makandra dev
This website uses cookies to improve usability and analyze traffic.
Accept or learn more