How to select month in calendar using xpath | Selenium Forum
M
Posted on 04/04/2016
Hi,

The index for month in the calendars is starting from index 0, so if I am selecting date as 12.12.2016, xpath shows the month as 12.11.2016. So instead of December, November is being selected in the calendar as the date.

How can I correct this in the script .

M
Replied on 04/04/2016

we have explained date picker in videos. have you watched it?


M
Replied on 05/04/2016

Yes, I have tried module 15, Makemytrip class from the video, that is when I encountered this issue.
Are you referring to the same video?


M
Replied on 05/04/2016

yes, how is it changing the month?


M
Replied on 05/04/2016

It has to do something with the indexing of months in the calendar on the website , Makemytrip.com
Whichever month we select in the function, previous month is being selected.

I tried giving the date as 12.12.2016 in the function, what was selected on the website was actually 12.11.2016.


M
Replied on 05/04/2016

so if you select 12.1.16 what does it do.


M
Replied on 06/04/2016

Cannot go back to past months as back button is disabled.


M
Replied on 06/04/2016

try with 12.1.17


M
Replied on 09/04/2016

I tried with 12/01/2017, it is selecting 12/12/2016.


M
Replied on 10/04/2016

then when selecting date add 1 month.

if you want to select 12/1/17 try to select 12/2/17 and so on.