How to select correct date in web application

Good day Developers,

Can you please help me in this automation… I want to register the employee birthday to a web system, but the problem is that the month and day is a select box.

How can the robot select the correct date to input in the web system.
Please see image below for reference.

image

image

Hi @flashdrive07

If you type the value you want, does the dropdown select the correct one? if not, then maybe you can try to use a dynamic click

Regards

Hi @flashdrive07

If you can try to click on that Calendar button and then get an option to type you can go ahead with that,

Split “1/15/2000” by “/” and then
you would have to create a dictionary for months mapping and date and year could be selected directly basis on splits of string.
FOR eg use a Switch Case with a Month as input and then your’ll get the value from dictionary.

Thanks
Happy Automation!

@adiijaiin
it cannot type into it…

@fernando_zuluaga
for the month yes, it can select the correct month. but for the day it cannot.

how is that dynamic click?

Hi @flashdrive07

If you have this date in InputDate = “1/15/2000”
You can Use the following:

DateDay=datetime.ParseExact(InputDate,“M/dd/yyyy”,System.Globalization.CultureInfo.InvariantCulture).Day
DateMonth=datetime.ParseExact(InputDate,“M/dd/yyyy”,System.Globalization.CultureInfo.InvariantCulture).ToString(“MMM”)
DateYear=datetime.ParseExact(InputDate,“M/dd/yyyy”,System.Globalization.CultureInfo.InvariantCulture).ToString(“MMM”)

image

try this.
And you would have to finetune the selector to select the appropriate Day and Year.

Thanks

Hi @adiijaiin

I already fix this, the only problem right now is the selection of correct day.
Can u help me improve the selection of the correct day

I already fix it… thanks guys.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.