From 1c367ad6a13333bc5c95b6218840eab26b0249c7 Mon Sep 17 00:00:00 2001 From: tawoe Date: Thu, 9 Feb 2023 11:05:59 +0100 Subject: [PATCH] bugfix terms and conditions, wait --- obp-api.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/obp-api.py b/obp-api.py index 5a99c19..8c06fa6 100644 --- a/obp-api.py +++ b/obp-api.py @@ -3,6 +3,8 @@ from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.remote.webelement import WebElement +from selenium.webdriver.support.wait import WebDriverWait +from selenium.webdriver.support import expected_conditions as EC class ObpAPI: @@ -41,7 +43,7 @@ def register(self) -> RegisterLogin: self._find_element_by_id("txtUsername").send_keys(RegisterLogin.USERNAME) self._find_element_by_id("textPassword").send_keys(RegisterLogin.PASSWORD) self._find_element_by_id("textPasswordRepeat").send_keys(RegisterLogin.PASSWORD) - self._find_element_by_id("terms_checkbox_value").click() + WebDriverWait(self.driver, 30).until(EC.presence_of_element_located((By.ID, "terms_checkbox").click())) self._find_element_by_id("privacy_checkbox").click() self._find_element_by_id("submit-button").click() # username_text = self._find_element_by_id("authuser_username").text