Unable to select date from dropdown Menu

Hello,
I am automating an application and there is a dropdown menu occurs which has dates listed under it. It has todays date at bottom but the bot should select yesterdays date like if today is 5 than it should select 4.

I tried using click activity but it is not selecting proper date as it`s not a reliable selector. which selector or activity i should use?

image

@utsav.patel

Can we type the date instead of selecting it from drop down ?

Hi,

There are lots of Date Picker which may have different different UI so use this
DatePickerOnWeb.xaml (49.0 KB)

as an example and solve your problem according to your use…

it is working for me…
DatePicker

please let me know if you want any help related this.

thank you!

1 Like

@Mohit_Yadav1 ,Thanks for this solution but can you post some screenshot of your code here because I am unable to load your .xaml file due to studio issues.

@lakshman yes we can type the date too. My approach will be to get the yesterdays date always so if bot can type yesterdays date in that field than that would be good too. For example today is 09/27/2021 than bot will have to enter 09/26/2021 in that field. a code or logic will be appreciated based on this

@utsav.patel

Try below expression to enter yesterday’s date.

                    Now.AddDays(-1).ToString("MM/dd/yyyy")

Hi,

Please find attached screenshots,

DatePickerScreenShots.zip (227.2 KB)

I wish it would be help full for you.

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