Skip to content

Instantly share code, notes, and snippets.

@keolo
Created January 13, 2012 00:03
Show Gist options
  • Save keolo/1603923 to your computer and use it in GitHub Desktop.
Save keolo/1603923 to your computer and use it in GitHub Desktop.
webdriver
# gem 'selenium-webdriver'
require 'rubygems'
require 'selenium-webdriver'
driver = Selenium::WebDriver.for :chrome
driver.get "http://google.com"
element = driver.find_element :name => "q"
element.send_keys "Cheese!"
element.submit
puts "Page title is #{driver.title}"
wait = Selenium::WebDriver::Wait.new(:timeout => 10)
wait.until { driver.title.downcase.start_with? "cheese!" }
puts "Page title is #{driver.title}"
driver.quit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment