Created
November 12, 2012 03:15
-
-
Save jaysonrowe/4057289 to your computer and use it in GitHub Desktop.
Checking Gmail with Selenium Webdriver in Python
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
#! /usr/bin/env python | |
import unittest | |
from selenium import webdriver | |
class TestGmail(unittest.TestCase): | |
def setUp(self): | |
self.driver = webdriver.Firefox() | |
def testLogin(self): | |
driver = self.driver | |
driver.get('http://www.gmail.com') | |
self.assertIn('Gmail', driver.title) | |
loginBox = driver.find_element_by_id('Email') | |
loginBox.send_keys('[email protected]') | |
pwBox = driver.find_element_by_id('Passwd') | |
pwBox.send_keys('!SuperSecretpassw0rd') | |
signinBtn = driver.find_element_by_id('signIn') | |
signinBtn.click() | |
def tearDown(self): | |
self.driver.quit() | |
if __name__ == '__main__': | |
unittest.main(verbosity=2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment