Python Forum
Getting error while accessing input box
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Getting error while accessing input box
#1
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  error accessing data kaykay 1 2,051 Dec-12-2018, 06:26 PM
Last Post: nilamo
  Getting error when accessing elements in a modal window of an webpage using selenium sumandas89 3 8,571 Jul-13-2018, 10:44 AM
Last Post: mlieqo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020