Skip to content

Instantly share code, notes, and snippets.

@aaronhumerickhouse
Created January 2, 2015 14:39
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 aaronhumerickhouse/9661a75419b93482a6fc to your computer and use it in GitHub Desktop.
Save aaronhumerickhouse/9661a75419b93482a6fc to your computer and use it in GitHub Desktop.
Selenium Script for Click Defect
require "selenium-webdriver"
profile = Selenium::WebDriver::Firefox::Profile.new
profile.native_events = true
driver = Selenium::WebDriver.for :firefox, profile: profile
driver.navigate.to 'http:/google.com'
element = driver.find_element(:name, 'q')
element.send_keys 'Hello Webdriver!'
element.submit
sleep 1
result_element = driver.find_elements(:css, 'h3.r')[0]
driver.action.move_to(result_element).click.perform
sleep 3
driver.quit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment