webdriver-user-agent gem now supports ruby 1.8.x

I have just released verion 0.1.0 of my webdriver-user-agent gem that makes it easy to run your watir-webdriver/selenium-webdriver tests against mobile device user agents.

The latest version supports ruby 1.8.x which previously generated an error because I was trying to use the .downcase method on a symbol (which was introduced in ruby 1.9.x).

Its usage remains the same. Enjoy.

Example using selenium-webdriver

require 'selenium-webdriver'
require 'webdriver-user-agent'

driver = UserAgent.driver(:browser => :chrome, :agent => :iphone, :orientation => :landscape)
driver.get 'http://tiffany.com'
driver.current_url.should == 'http://m.tiffany.com/International.aspx'

Example using watir-webdriver

require 'watir-webdriver'
require 'webdriver-user-agent'

driver = UserAgent.driver(:browser => :chrome, :agent => :iphone, :orientation => :landscape)
browser = Watir::Browser.new driver
browser.goto 'tiffany.com'
browser.url.should == 'http://m.tiffany.com/International.aspx'

Author: Alister Scott

Alister is an Excellence Wrangler for Automattic.