Created
November 15, 2012 03:22
-
-
Save jaysonrowe/4076446 to your computer and use it in GitHub Desktop.
Checking Gmail with Selenium Webdriver in Ruby
This file contains hidden or 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 'rubygems' | |
require 'selenium-webdriver' | |
require 'test-unit' | |
class GmailLoginTest < Test::Unit::TestCase | |
def setup | |
@driver = Selenium::WebDriver.for :firefox | |
@driver.get "http://www.gmail.com" | |
end | |
def test_page_title | |
assert_equal @driver.title, "Gmail: Email from Google" | |
end | |
def test_login | |
loginBox = @driver.find_element(:id, "Email") | |
loginBox.send_keys("[email protected]") | |
pwBox = @driver.find_element(:id, "Passwd") | |
pwBox.send_keys("!SuperSecretpassw0rd") | |
signinBtn = @driver.find_element(:id, "signIn") | |
signinBtn.click() | |
end | |
def teardown | |
@driver.quit | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment