def add_poll(self, question, *answers): actions = Actions(self.driver) actions.click_to_element(By.XPATH, self.ADD_POLL_CHECKBOX) actions.send_keys_to_elem_and_perform(By.XPATH, self.QUESTION_POLL, question) count = len(answers) for index in range(count): answer_xpath = self.ANSWEAR_POLL.format(index) if not actions.element_is_exist(By.XPATH, answer_xpath): answer_xpath += '[2]' actions.click_and_wait(By.XPATH, self.ADD_OPTION_ANSWER, By.XPATH, answer_xpath) actions.send_keys_to_elem_and_perform(By.XPATH, answer_xpath, answers[index])
def delete(self): actions = Actions(self.driver) actions.click_to_element(By.XPATH, self.DELETE_BUTTON) actions.click_to_element(By.XPATH, self.DELETE_BUTTON_CONFIRM)