Skip to content

Instantly share code, notes, and snippets.

@ckenst
Last active August 15, 2017 22:46
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 ckenst/30858fc46291c872ef377876ddbd325f to your computer and use it in GitHub Desktop.
Save ckenst/30858fc46291c872ef377876ddbd325f to your computer and use it in GitHub Desktop.
IRB Selenium example
#our REPL of choice is irb, could also use pry
irb
#require the selenium webdriver library
require 'selenium-webdriver'
#launch chrome as our driver
driver = Selenium::WebDriver.for :chrome
#navigate to google
driver.get 'http://www.google.com'
#search google
element = driver.find_element :name => 'q'
element.send_keys 'Kenst'
element.submit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment