Skip to content

Instantly share code, notes, and snippets.

@shoesCodeFor
Created April 24, 2019 16:21
Show Gist options
  • Save shoesCodeFor/1150421b7ca3da33ae28b495fb681de8 to your computer and use it in GitHub Desktop.
Save shoesCodeFor/1150421b7ca3da33ae28b495fb681de8 to your computer and use it in GitHub Desktop.
Simple Firefox/Selenium Login
require "selenium-webdriver"
# Not quite sure where Selenium think the Firefox binary is by default
driver = Selenium::WebDriver.for :firefox
driver.navigate.to "http://duckduckgo.com"
element = driver.find_element(name: 'q')
element.send_keys "Selenium Firefox Ruby Bindings"
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