I am trying to feed date field using selenium through python. Date field in the website has a date picker with two months shown in that. Here is the detail about that element.
<input id="depart-date-webform-client-form-1642116421-4" class="fcl-datepicker-widget-desktop fcl-datepicker-widget form-text required hasDatepicker" data-type="departing" data-cid="webform-client-form-1642116421-4" autocomplete="off" placeholder="dd/mm/yy" name="submitted[startDate]" value="" size="60" maxlength="128" type="text">
I am placing the cursor in that field, then wait for 2 seconds till the date picker id appears, and trying to feed the date by selecting the date's id.
self.driver.find_element_by_xpath("//input[@id='depart-date-webform-client-form-1642116421-4']").click()
WebDriverWait(self.driver, 2).until(
lambda d: d.find_elements_by_id('ui-datepicker-div')[0].is_displayed())
self.driver.find_element_by_xpath("//div[@id='ui-datepicker-div']//td[@data-year='2016'][@data-month='2']/a[@class='ui-state-default'][text()='19']").click()
I can see that the date is selected successfully in the field when i try to simulate that action by calling firefox through selenium. Next line in my script is this,
self.driver.find_element_by_xpath('//input[@type="submit"]').click()
But I am getting the below error.
selenium.common.exceptions.WebDriverException: Message: Element is not clickable at point (136, 15.399993896484375). Other element would receive the click: <td class=" ui-datepicker-other-month ui-datepicker-unselectable ui-state-disabled"></td>
Please point me in the right direction.
Note : Sometime this is working, once in multiple times. Out of 5, 1 time it is working. Rest of the times I am getting this error.
Thanks.