0
<input placeholder="MM/DD/YYYY" autocomplete="on" type="text" class="form-control" value="01/01/2020" style="height: 40px; color: (25, 25, 25); font-weight: bold; font-size: 14px; background: >

error: Message: element not interactable

3
  • code: #Datepicker datefield = browser.find_element_by_id('datepicker-start_group') datefield.send_keys("01/01/2020") time.sleep(5) datefield = browser.find_element_by_id('datepicker-end_group') datefield.send_keys("02/14/2020") Commented Jul 20, 2021 at 3:32
  • error: ElementNotInteractableException: Message: element not interactable Commented Jul 20, 2021 at 3:33
  • <span id="datepicker-start_group" class=""> <input placeholder="MM/DD/YYYY" autocomplete="on" type="text" class="form-control" value="01/01/2020" style="height: 40px; color: rgb(25, 25, 25); font-weight: bold; font-size: 14px; background: rgb(255, 255, 255); border: 1px solid rgb(214, 214, 214); border-radius: 4px; box-shadow: none;"> Commented Jul 20, 2021 at 3:33

2 Answers 2

1

Can you check this

#You can select the datepicker based on the XPath index [1][2]

date_input = driver.find_element_by_xpath('((//input[@type='text']))')
date_input.click()                      
date_input.send_keys(Keys.CONTROL, "a") 
date_input.send_keys(Keys.BACKSPACE)    
date_input.send_keys("02/14/2020",Keys.RETURN) 
Sign up to request clarification or add additional context in comments.

Comments

0

This is my python script for date picker. Hope this can be useful in someways.

from selenium import webdriver
#set chromodriver.exe path
driver = webdriver.Chrome(executable_path="C:\\chromedriver.exe")
driver.implicitly_wait(0.5)
#launch URL
driver.get("https://jqueryui.com/datepicker/")
#switch to frame
l = driver.find_element_by_xpath("//iframe[@class='demo-frame']")
driver.switch_to.frame(l);
#identify element inside frame
d= driver.find_element_by_id("datepicker")
d.click()
#identify list of all dates
m = driver.find_elements_by_xpath("//table/tbody/tr/td")
#iterate over list
for i in m:
#verify required date then click
   if i.text == '3':
      i.click()
   break
#get selected date
s = d.get_attribute('value')
print("Date entered is: ")
print(s)
#browser quit
driver.quit()

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.