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 TestGmail(unittest.TestCase):
- @classmethod
- def setUpClass(cls):
- cls.url = "https://mail.google.com/mail/u/1/#inbox/"
- cls.driver = webdriver.Chrome()
- cls.driver.implicitly_wait(10)
- cls.username = "222icecream222@gmail.com"
- cls.username_xpath = "//input[@type='email']"
- cls.next_button = "identifierNext"
- cls.password_xpath = "//input[@name='password']"
- cls.password = "222111222"
- cls.next_button2 = "passwordNext"
- @classmethod
- def tearDownClass(cls):
- #cls.driver.quit()
- pass
- def login(self, username, password):
- self.driver.find_element_by_xpath("//input[@type='email']").send_keys(username)
- self.driver.find_element_by_id("identifierNext").click()
- self.driver.find_element_by_xpath("//input[@name='password']").send_keys(password)
- self.driver.find_element_by_id("passwordNext").click()
- self.driver.find_element_by_xpath("//div[@class='T-I J-J5-Ji T-I-KE L3']").click()
- def test_work_gmail(self):
- self.driver.get(self.url)
- self.login(self.username, self.password)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement