July 11, 2014

Selenium vs. Poltergeist vs. Capybara-webkit. Which one is the fastest?

I know three web drivers for running JavaScript tests with capybara. Selenium (which is the default), poltergeist and capybara-webkit.

Selenium webdriver starts firefox and perform all tests in it. On the other hand poltergeist and capybara-webkit are headless wekbit browsers, so there are no windows popping up. There are of course also other differences between these web drivers, but I was mainly curious in the speed.

I have one application with eleven JavaScript specs, so I did some measurements and here are the results:

  1. capybara-webkit, 7.23 seconds
  2. poltergeist, 8.75 seconds
  3. selenium, 17.02 seconds

Above values are running time averages for three runs of all eleven JavaScripts specs. As you can see, there is relatively small difference in capybara-webkit and poltergeist. But there is a huge gap between poltergeist and selenium.


Don't use default selenium webdriver. Choose between capybara-webkit and poltergeist based on your feature needs. If you do not have any feature preference, then just use capybara-webkit.

Hey there!

My name is Patrik Bóna and I am the only programmer at Memberful. This blog is kind of dead, but I just started my own Ruby on Rails screencast. Follow me on Twitter if you want to be notified about my newest videos.