Automation of Date picker

Hi Can Someone help me automate calender in Ui path.

Challanges :

UI path should select dates falling on Monday’s only as start dates and end dates only on Tuesdays in any given month.

The date picker should be dynamic in nature like if we open calendar and select 24th Monday 2023 - 25th Tuesday 2023.

And it should set the time on every Monday From : 05:00 AM to Tuesday 23:00. Time remains constant for any given Monday and Tuesday.

Note this activity needs to be performed from date picker in web application in Chrome Browser

Thank you in advance appreciate the forum’s help


Welcome to the community

Dont you have option to keyin the date? In any firld generally we see that option…if available better use type into

If that is not the case then the following might help

And for picking date logic you can calculate using functions and can pass dependign on the logic that you want the dates to be



Hope the below steps would help you resolve this

  1. Use the “Open Browser” activity to open the web application in Google Chrome.
  2. Use the “Click” activity to click on the date picker element to open the calendar.
  3. Use the “Get Text” activity to get the month and year of the currently displayed calendar.
  4. Use a loop (e.g., a “While” activity) to iterate over each day of the calendar.
  5. For each day in the calendar, use the “Get Attribute” activity to check the “class” attribute of the day element.
  6. If the “class” attribute contains the string “day–monday”, use the “Click” activity to select the day as the start date.
  7. If the “class” attribute contains the string “day–tuesday”, use the “Click” activity to select the day as the end date.
  8. Use the “Click” activity to confirm the selected dates and close the date picker.
  9. If necessary, use the “Type Into” activity to set the desired time range for the selected dates.
  10. Repeat the process for each month as needed.

Cheers @sreekanth1

@sreekanth1 you can also try this

e.g. if the element has id = departureDate

you can use inject JS activity with the following properties
script code- txt file containing js code
parameter - date to set

txt file should contain the following

document.getElementById("departDate").value = in_date;


Welcome to forums

Can you share the screenshot of the calender which you are referring to?