123456789101112131415161718 |
- from selenium.webdriver.support import expected_conditions as EC
- from selenium.webdriver.common.by import By
- import time
- class page_task():
- button_back_to_main_xpath = "//*[@id='__next']/div/div[1]/nav/div[2]/div[2]/div[2]/div/div"
- def __init__(self,driver,wait):
- self.driver = driver
- self.wait = wait
-
- def wait_back_to_main_button(self):
- self.wait.until(EC.element_to_be_clickable((By.XPATH, self.button_back_to_main_xpath)))
- time.sleep(10)
- def click_back_to_main_button(self):
- self.driver.find_element_by_xpath(self.button_back_to_main_xpath).click()
|