Jul-13-2018, 12:22 PM
I wrote a code like below -
driver.find_element_by_xpath('/html/body/div[4]/div[2]/div/div[2]/div[2]/div/ul/li[2]/a').click() '''Entering The Input Name and Continue Search''' driver.find_element_by_xpath('//*[@id="d_value"]').send_keys('Suman Das') driver.find_element_by_xpath('//*[@id="mobile_other_search"]/div/div[6]/div/div[1]/button[1]').click()And here I am getting exception like below -
Error: raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementNotInteractableException: Message: Element <input id="d_value" class="form-control" name="d_value" type="text"> is not reachable by keyboard
So then I added a WebdriverWait and changed the code like below -driver.find_element_by_xpath('/html/body/div[4]/div[2]/div/div[2]/div[2]/div/ul/li[2]/a').click() '''Entering The Input Name and Continue Search''' WebDriverWait(driver,10).until(EC.visibility_of_element_located((By.XPATH,'//*[@id="d_value"]'))) driver.find_element_by_xpath('//*[@id="d_value"]').send_keys('Suman Das') driver.find_element_by_xpath('//*[@id="mobile_other_search"]/div/div[6]/div/div[1]/button[1]').click()But now I am getting timeout exception -
Error:File "/home/csurv_4/PycharmProjects/tathya_brityanta/run_a_bot.py", line 42, in <module>
WebDriverWait(driver,10).until(EC.visibility_of_element_located((By.XPATH,'//*[@id="d_value"]')))
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:
I also used -WebDriverWait(driver,10).until(EC.visibility_of_element_located((By.CLASS_NAME,'form-control')))But the same Exception arises.