My Coding Blog

Hacking on everyday programming annoyances

Stop Selenium Loading Firefox in the Foreground

In my day job, an important part of our testing suite involves driving Firefox via RSpec feature specs. Which is realised through the use of the Capybara and Selenium Webdriver gems.

As all testing suites grow, we eventually introduced the awesome Parallel Tests gem, cutting run-times dramatically. An unfortunate side effect however, multiple instances of Firefox randomly opening in the foreground and stealing focus.