0

I am trying to fill a form and click submit

Been able to fill text boxes/select radio button etc but when trying to click on the submit button, it gives me below exception

raceback (most recent call last):
  File ".\submitemail.py", line 81, in <module>
    WebDriverWait(driver, 2).until(EC.element_to_be_clickable((By.XPATH,"//*[@id='submit']"))).click()
  File "C:\Users\Programs\Python\Python38-32\lib\site-packages\selenium\webdriver\support\wait.py", line 80, in until
    raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message:

Code I am trying is below

WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.XPATH,"//*[@id='submit']"))).click()

Tryied putting manual sleep before executing this line as well but with the same error

3
  • could yo uadd full stack out put and what happendd s when you simply give element.click() Commented Dec 10, 2020 at 8:43
  • Update the question with the relevant text based HTML Commented Dec 10, 2020 at 9:15
  • @PDHide: I added the full exception message Commented Dec 10, 2020 at 9:25

1 Answer 1

1

I used execute_script instead first approach and this has solved the problem

btn = driver.find_element_by_xpath("//*[@id='submit']")
driver.execute_script("arguments[0].click();", btn)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.