Chromedriver/Chrome is pretty great at executing WebDriverJs scripts without taking away your focus (so you can execute them in the background whilst doing other things), the one exception I found was selecting items in a select list. I found it would do this:

I’ve tested it on a large test suite (123 scenarios) and it behaves the same as other browsers with full JavaScript support. It took 8m13s in total: surprisingly it is slightly slower than ChromeDriver (7m30s) in my testing, but a little faster than the Firefox Driver (9m33s).

Well done to all involved in this project. It’s great to see a reliable, realistic headless browser with full JavaScript support for WebDriver finally released.

A colleague contacted me today to see if there’s a way to increase the speed of a text_field.set operation in watir-webdriver when using Chrome on Mac OSX. I hadn’t noticed it before but Chrome seems to enter character by character into text fields which is noticeably slower than Firefox which seems to ‘set’ the field at once. Jari Bakken suggested I try Chrome native events which I didn’t even realize existed on Mac OSX.

So, I took Jari’s suggestion and I created a benchmark of a .set operation conducted ten times in a row on Firefox, and Chrome with and without native events. The results looked like:

You can see that Chrome is drastically slower than Firefox in setting text fields, but native events does seem to provide a roughly 25% speed improvement. I think I will stick to running my watir-webdriver tests against Firefox unless specifically needed.

Anyone who has used Watir-WebDriver (or WebDriver for that matter) to test Google Chrome will know that it’s been pretty unreliable, and pretty much unusable in the past… until now.

The ChromeDriver executable was released recently which enables WebDriver to control Google Chrome natively using the Wire protocol. This means your Watir-WebDriver tests will run super fast, and super reliably.

For Mac OSX:

Get the latest Watir-WebDriver gem

gem update watir-webdriver

Download the ChromeDriver binary from the Chromium site, and copy it to your path (such as /usr/local/bin/)

This will work with any current version of Chrome

Change your Watir-WebDriver script to use Watir::Browser.new :chrome and voila, super fast Chrome, with no weird first tab opened in the background. This is the key to tell if you’re doing it right, your app should appear in the first tab of Chrome, not the second.

I haven’t done this on Windows yet, so your mileage may vary, but I imagine it wouldn’t be too different.