Could you please help me with below HTML and selenium?
I am trying to click on the toggle button by id "elm_guest_code_auto_generate" and here is my python code:
toggle_button = WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.ID, "elm_guest_code_auto_generate")))# Check if the toggle button is inactiveif "checked" not in toggle_button.get_attribute("outerHTML"): # If the toggle button is inactive, click on it to activate it toggle_button.click() print("Toggle button activated.")else: print("Toggle button is already active.")
and I am getting this error:
Traceback (most recent call last): File "C:\Users\muraril\PycharmProjects\pythonProject\GuestProfileRules\GuestProfileRule.py", line 73, in <module> toggle_button = WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.ID, "elm_guest_code_auto_generate"))) File "C:\Users\muraril\PycharmProjects\pythonProject\.venv\lib\site-packages\selenium\webdriver\support\wait.py", line 105, in until raise TimeoutException(message, screen, stacktrace)selenium.common.exceptions.TimeoutException: Message: