Skip to content

Instantly share code, notes, and snippets.

@manojnaidu619
Created May 8, 2018 15:12
Show Gist options
  • Save manojnaidu619/189d6c08203a0c4c5ed946eda9790c45 to your computer and use it in GitHub Desktop.
Save manojnaidu619/189d6c08203a0c4c5ed946eda9790c45 to your computer and use it in GitHub Desktop.
Gmail login ruby script using WATIR webdriver
require 'watir'
browser = Watir::Browser.new(:firefox)
browser.goto("https://www.gmail.com")
sleep 2
browser.text_field(class: "whsOnd zHQkBf").set "YOUR EMAIL ADDRESS HERE"
sleep 2
browser.span(index: 4).click
sleep 2
browser.text_field(name: "password").set "YOUR EMAIL PASSWORD HERE"
sleep 2
browser.send_keys :enter
# Make sure you run latest version of firefox
# Make sure you have installed geckodriver (a firefox webdriver) in your ruby executable path.
# go to terminal and type --> ruby gmail_login.rb
# sit back and watch it in action!!
@americanSammy
Copy link

found you via youtube. Thanks for the video explanation!

@manojnaidu619
Copy link
Author

manojnaidu619 commented Aug 7, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment