Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from selenium import webdriver
- from selenium.webdriver.common.by import By
- from selenium.webdriver.support.ui import WebDriverWait
- from selenium.webdriver.support import expected_conditions as EC
- import unittest
- class MailWork(unittest.TestCase):
- @classmethod
- def setUpClass(cls):
- cls.url = "https://mail.google.com/"
- cls.driver = webdriver.Chrome()
- cls.driver.implicitly_wait(10)
- cls.username = "test8814test@gmail.com"
- cls.password = "02031990x"
- @classmethod
- def tearDownClass(cls):
- #cls.driver.quit()
- pass
- def login(self, username, password):
- self.driver.find_elements_by_xpath("//input[@type='email']").send_keys(username)
- self.driver.find_element_by_id("identifierNext").click()
- self.driver.find_elements_by_xpath("//input[@type='password']").send_keys(password)
- self.driver.find_elements_by_id("passwordNext").click()
- def test_work_mail(self):
- self.driver.get(self.url)
- self.login(self.username, self.password)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement