Skip to content

Instantly share code, notes, and snippets.

@santiycr
Created April 4, 2011 01:33
Show Gist options
  • Save santiycr/901025 to your computer and use it in GitHub Desktop.
Save santiycr/901025 to your computer and use it in GitHub Desktop.
require 'rubygems'
require "watir-webdriver"
username = "sso"
access_key = ENV['KEY']
# caps = {:platform => "WINDOWS", :version => "6", :browserName => "internet explorer", :name => "Watir in the cloud"}
# caps = {:platform => "WINDOWS", :version => "7", :browserName => "internet explorer", :name => "Watir in the cloud"}
# caps = {:platform => "WINDOWS", :version => "8", :browserName => "internet explorer", :name => "Watir in the cloud"}
caps = {:platform => "VISTA", :version => "9", :browserName => "internet explorer", :name => "Watir in the cloud"}
browser = Watir::Browser.new(:remote,
:url => "http://#{username}:#{access_key}@saucelabs.com:4444/wd/hub",
:desired_capabilities => caps)
browser.goto("http://google.com")
puts browser.title
browser.text_field(:name => 'q').set("Watir in the cloud, yay!")
browser.button(:name => 'btnG').click
puts browser.title
browser.close
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment