Skip to content

Instantly share code, notes, and snippets.

@ckenst
Last active Aug 15, 2017
Embed
What would you like to do?
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