from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By import time class page_sign_and_send_prepare(): button_upload_pdf_xpath = "//*[@id='__next']/div/div[2]/div[1]/div/div/div/div/input" button_next_step_xpath = "//*[@id='__next']/div/div[1]/div[2]/div[4]" def __init__(self,driver,wait): self.driver = driver self.wait = wait def wait_pdf_button(self,time_length): time.sleep(time_length) def upload_pdf_button(self,pdf_path): upload_element = self.driver.find_element_by_xpath(self.button_upload_pdf_xpath) upload_element.send_keys(pdf_path) def wait_next_step_button(self): self.wait.until(EC.element_to_be_clickable((By.XPATH, self.button_next_step_xpath))) def click_next_step_button(self): self.driver.find_element_by_xpath(self.button_next_step_xpath).click()