Željko Filipin's Blog on Software and Testing

Test like you do not need the money.

watir-webdriver tests at TestingBot

with 4 comments

Random photo: Varaždin, Croatia.

Random photo: Varaždin, Croatia.

To make it explicit: I am not affiliated with TestingBot or Sauce Labs.

A few days ago I wrote about how to run watir-webdriver tests at Sauce Labs OnDemand. I have also noticed that watir-webdriver tests are pretty slow at Sauce Labs OnDemand.

Jari Bakken suggested to use net-http-persistent gem to speed things up. Jochen Delabie suggested I should try TestingBot. So, I have decided to try both.

TestingBot is pretty much the same service as Sauce Labs OnDemand. There is also 200 minutes of free trial, and the prices are a bit lower than Sauce Labs OnDemand. If you have used Sauce Labs OnDemand, TestingBot will look familiar. If you have not used Sauce Labs OnDemand, read the last couple of articles I have wrote here.

So, what you need to do to run your tests at TestingBot?

If you already run tests at Sauce Labs OnDemand:

require "watir-webdriver"
caps = Selenium::WebDriver::Remote::Capabilities.firefox
caps.version = "11"
caps.platform = :LINUX
caps[:name] = "testing this cloud thing"
browser = Watir::Browser.new(
  :remote,
  :url => "http://username:api-key@ondemand.saucelabs.com:80/wd/hub",
  :desired_capabilities => caps)

you only have to change caps.version and :url. Depending on the platform and browser, check if you have to change other settings too. (Supported operating systems: Sauce Labs OnDemand, TestingBot.)

require "watir-webdriver"
caps = Selenium::WebDriver::Remote::Capabilities.firefox
caps.version = 11
caps.platform = :LINUX
caps[:name] = "testing this cloud thing"
browser = Watir::Browser.new(
  :remote,
  :url => "http://key:secret@hub.testingbot.com:80/wd/hub", 
  :desired_capabilities => caps)

Of course, replace key and secret with your credentials.

I have run pretty much the same script as in the previous post. The script opens the browser, goes to 9 sites and closes the browser. Actually, it does that with and without using net-http-persistent gem, on a local browser, at Sauce Labs OnDemand and at TestingBot.

(I could not figure out how to make the last two columns display rounded numbers.)

What do the numbers say?

net-http-persistent gem this time helped to reduce test run time up to 10%, but other tests showed up to 15% shorter times.

TestingBot is still about 2 times slower than running a local browser, but Sauce Labs OnDemand is about 4 times slower. So, running tests at TestingBot is about 2 times faster than at Sauce Labs OnDemand.

As usual, if you want to run the script yourself, here it is:

Written by Željko Filipin

May 31st, 2012 at 4:19 pm

4 Responses to 'watir-webdriver tests at TestingBot'

Subscribe to comments with RSS or TrackBack to 'watir-webdriver tests at TestingBot'.

  1. Thanks for posting this Zeljko!
    I am kicking the tires with my Cuke/Selenium-Webdriver Suite and Testbot seems a bit snappier for less $$.

    Rich Downie

    31 May 12 at 5:18 pm

  2. As usual, these number mean nothing if your use case is different. I have provided the entire script so others could run it on their sites and compare the numbers.

    Željko Filipin

    31 May 12 at 9:58 pm

  3. Jari Bakken said on Twitter:

    Just so you know, local Firefox doesn’t support Keep-Alive. Using a persistent connection locally won’t improve speed.

    Željko Filipin

    31 May 12 at 9:59 pm

  4. [...] Watir-webdriver Tests at Testingbot [...]

Leave a Reply