Jul-12-2018, 02:04 PM
(This post was last modified: Jul-12-2018, 02:04 PM by sumandas89.)
I am writing python code to access elements in a modal dialog box of a webpage. After clicking in a link the modal dialog box appears till this point code works fine but when I am finding elements and trying to access the elements(input button,choosing options from the dropdown menu) in the modal window the error comes.
I have the Image screenshots of the modal window and the code of that but I don't know how to attach those files from my local drive to here.
Below is the code where I am getting the errors.
I have the Image screenshots of the modal window and the code of that but I don't know how to attach those files from my local drive to here.
Below is the code where I am getting the errors.
driver.find_element_by_xpath('//*[@id="form"]/div[5]/button').click() driver.find_element_by_xpath('/html/body/div[4]/div[2]/div/div[3]/a[4]/div/div[2]/i').click() try: element = WebDriverWait(driver, 10).until(EC.visibility_of_element_located((By.ID, '//*[@id="myModal"]'))) finally: driver.quit() driver.find_element_by_xpath('//*[@id="myModal"]/div/div/div[3]/button[1]').click()And this is Error What I am getting.
Error: File "/home/csurv_4/PycharmProjects/tathya_brityanta/run_a_bot.py", line 34, in <module>
element = WebDriverWait(driver, 10).until(EC.visibility_of_element_located((By.ID, '//*[@id="myModal"]')))
File "/home/csurv_4/PycharmProjects/tathya_brityanta/venv/lib64/python3.6/site-packages/selenium/webdriver/support/wait.py", line 80, in until
raise TimeoutException(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message:
Can anyone could suggest me any solution to this?