Skip to content

Instantly share code, notes, and snippets.

@harsh183
Created January 15, 2019 02:44
Show Gist options
  • Save harsh183/00904e3f00c8c5a54f143f3deefe9897 to your computer and use it in GitHub Desktop.
Save harsh183/00904e3f00c8c5a54f143f3deefe9897 to your computer and use it in GitHub Desktop.
This script uses selenium to login into uiuc's google apps login.
require 'watir'
require 'webdrivers'
@browser = Watir::Browser.new :firefox
# Standard google apps login page
@browser.goto("https://accounts.google.com/signin/v2/identifier?hl=en&passive=true&continue=https%3A%2F%2Fwww.google.com%2F&flowName=GlifWebSignIn&flowEntry=ServiceLogin")
# First pass google (google is weird, my input field selectors weren't )
@browser.send_keys "hdeep2@illinois.edu" # Can be anything that exists
@browser.send_keys :enter
# Now the shibbolet login
@browser.input(id: "j_username").send_keys "hdeep2"
@browser.input(id: "j_password").send_keys "valid_password"
@browser.inputs(type: "submit")[0].click
binding.pry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment