page_task.py 616 B

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