How to click date on calendar?

Hello everyone!

I want to click Start Date and End Date from this webpage.
Screenshot_1

I have passed the variable to selector. But it is not clicking,
Anyone can help me out ?

Hey @RobotUi
you can try use Inject JS Script activity.
Example usage of java script:

function (element, input) {
    document.querySelector('#startDateSelector').click(); // Replace #startDateSelector with the actual selector
    document.querySelector('#endDateSelector').click(); // Replace #endDateSelector with the actual selector
}
1 Like

@RobotUi

Looks like type into works on it…try typing

Cheers

No, it does not works.

@RobotUi

Try with set text…if that also does not work…here is an example

Cheers

1 Like

ok i got solution for it.

But can you teach me a way so that i can remove leading 0 from day in date.

Like 09-12-2023, i need only day without 0

@RobotUi

DateTime.ParseExact(datestring,"dd-MM-yyyy",System.Globalization.CultureInfo.InvariantCulture).Day.ToString will give only date without 0

.ToString("MMMM") will give month

.Year.Tostring will give year

Cheers

Can i do something like Convert.ToInt16(passOnlyDayHere)

@RobotUi

if you need as integer then just remove .ToString after day

if you directly give date inside it it wont work

cheers

Hi @RobotUi ,

Refer this link you will find the solution it may help full.

Link :- https://youtu.be/yf2LcQATy9I?si=hxT8uVR587b7mfcY

Regard,

Techystack

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