I have to automate a website where the user provides OTP and clicks on a button. This part cannot be automated since OTP is unknown. So i need the selenium script to wait until the user clicks on the button. Is there any way to accomplish this?(By means of selenium not with user interaction)
Tried this :
from selenium.webdriver.support.ui import WebDriverWait
WebDriverWait(driver, 1).until(lambda d: d.execute_script("return document.getElementById('loginbutton').clicked")=="true")
But the following error is thrown :
WebDriverWait(driver, 1).until(lambda d: d.execute_script("return document.getElementById('loginbutton').clicked")=="true") File "C:\Users\project\venv\lib\site-packages\selenium\webdriver\support\wait.py", line 80, in until raise TimeoutException(message, screen, stacktrace) selenium.common.exceptions.TimeoutException: Message: Process finished with exit code 1
document.getElementById('loginbutton').clicked
Gives undefined when performed on developers tool, could that be the cause for above error?