Advertisement
Guest User

Untitled

a guest
Nov 28th, 2017
386
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.05 KB | None | 0 0
  1. from selenium import webdriver
  2. from selenium.webdriver.common.by import By
  3. from selenium.webdriver.support.ui import WebDriverWait
  4. from selenium.webdriver.support import expected_conditions as EC
  5. import unittest
  6.  
  7.  
  8. class MailWork(unittest.TestCase):
  9.     @classmethod
  10.     def setUpClass(cls):
  11.         cls.url = "https://mail.google.com/"
  12.         cls.driver = webdriver.Chrome()
  13.         cls.driver.implicitly_wait(10)
  14.         cls.username = "test8814test@gmail.com"
  15.         cls.password = "02031990x"
  16.  
  17.     @classmethod
  18.     def tearDownClass(cls):
  19.         #cls.driver.quit()
  20.         pass
  21.  
  22.     def login(self, username, password):
  23.         self.driver.find_elements_by_xpath("//input[@type='email']").send_keys(username)
  24.         self.driver.find_element_by_id("identifierNext").click()
  25.         self.driver.find_elements_by_xpath("//input[@type='password']").send_keys(password)
  26.         self.driver.find_elements_by_id("passwordNext").click()
  27.  
  28.     def test_work_mail(self):
  29.         self.driver.get(self.url)
  30.         self.login(self.username, self.password)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement