Я учу питона и селена. Я пытаюсь создать новый проект с шаблоном объекта Page, и у меня есть проблема с WebdriverWait, вы можете увидеть мой код, а затем я пишу, как получаю ошибку.
Метод на странице:
def testStart(self):
WebDriverWait(self.driver, 15).until(
expected_conditions.element_to_be_clickable((By.ID,
StartPage.username))
)
user = self.driver.find_element(*StartPage.username)
user.click()
Мой тест - просто;)
startPage = StartPage(self.driver)
startPage.testStart()
И локаторы:
username = (By.ID, 'username')
и ошибка:
selenium.common.exceptions.WebDriverException: Message:
invalid argument: 'value' must be a string
Когда я проверяю метод на странице:
def testStart(self):
WebDriverWait(self.driver, 15).until(
expected_conditions.element_to_be_clickable((By.ID,
*StartPage.username))
)
user = self.driver.find_element(*StartPage.username)
user.click()
У меня было:
TypeError: find_element() takes from 1 to 3 positional arguments but 4 were given
Как я могу это изменить?