Skip to content

Instantly share code, notes, and snippets.

@mogya
Created January 29, 2014 08:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mogya/8684022 to your computer and use it in GitHub Desktop.
Save mogya/8684022 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'rubygems'
require 'selenium-webdriver'
caps = Selenium::WebDriver::Remote::Capabilities.iphone
caps.version = "5.0"
caps.platform = :MAC
caps[:name] = "Testing Selenium 2 with Ruby on Sauce"
driver = Selenium::WebDriver.for(
:remote,
:url => "http://YOUR REMOTE DRIVER URL@ondemand.saucelabs.com:80/wd/hub",
:desired_capabilities => caps)
driver.navigate.to "http://www.google.com"
element = driver.find_element(:name, 'q')
element.send_keys "Hello WebDriver!"
element.submit
puts driver.title
driver.quit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment