Last active
August 29, 2015 14:14
-
-
Save jmieleiii/e0e5df200ea37dbec1ec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "selenium-webdriver" | |
driver = Selenium::WebDriver.for :chrome | |
driver.get('https://www.soul-cycle.com') | |
# login as your user - replace username and password | |
driver.find_element(:class, "log-in").click | |
sleep 1 | |
driver.find_element(:name, "email").send_keys("[email protected]") | |
driver.find_element(:name, "password").send_keys("tester") | |
driver.find_element(:name, "submit").click | |
sleep 1 | |
# go to the account info/billing page | |
driver.get('https://www.soul-cycle.com/me/account/payment/') | |
# expiration month element | |
dropdown = driver.find_element(:id, "dk_container_frm-cc_month").find_element(:class, "dk_toggle") | |
dropdown.click | |
sleep 1 | |
# this throws the cannot focus element error | |
5.times { dropdown.send_keys(:arrow_down) } | |
dropdown.send_keys(:enter) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment