Click Start and End Date to download a report

Hi All,

I would like to download a report from the client’s portal on a daily basis.

Bot has to click on “Start Date” (previous day) and “End Date” (current date) to download the report.
Bot runs daily except weekends.

Help me to achieve this dynamically.

Working days - Monday - Friday

For Monday, the “start date” day will be Friday.

Regards,
Dev

@devanand.1292

Now.ToString("MM/dd/yyyy") the format can be changed as per your requirement…this gives the current date for you its end date

for start date use Now.AddDays(If(Now.DayOfWeek.ToSTring.Equals("Monday"),-3,-1)).ToString("MM/dd/yyyy") and here as well you can replace the format as needed

Hope this helps

cheers

Thanks Anil.

The case is Bot has to dynamically select the start date and end date on a daily basis.

I have spied the UI elements. I want it to run dynamically.

If bot runs today, it has to select previous day’s date and current date by using click activity.

How to change the selectors dynamically for start date and end date. Please help.

@devanand.1292

In the selector you will have innertext field…add variables inplace of them…you can do that by opening selector in the activity and then right click where you want to add the variable and select the bariable you want to add…

And store the above expressions in start and end variables

<webctrl tag=‘div’ innertext=‘{{startvar}}’ />

This is how it looks…this is a dummy selector… explore selector from ui explorer if not already done…

Cheers

1 Like

Thanks so much Anil.

I will apply this logic and test the bot.

Will share the outcome… Appreciate your timely help.

1 Like

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