How to pass variable into selector


I have requirement where i need to choose the date field from calendar.(Website).
i have gone through the post in the forum already .
please find the screenshot of the selector where u can see aaname=21 is date field which i choose.
so now i want to pass the variable in that field according to my required date field.
How to pass it(any syntax i’m missing here)

any help must be appreciated .

This is from my code

"<webctrl aaname='"+dateVal+"' parentid='ui-datepicker-div' tag='A' />"
1 Like

i tried this with ur earlier post its showing error. syntax error.
anyway let me try it.
Hope my approach is right?

Paste the syntax error you are getting

this is the error.
Cannot find the UI element corresponding to this selector:

Probably tablerow is varying as well

Do this way:

Drop click activity and paste your selector.Don’t indicate anything.

"<webctrl aaname='"+dateVal+"' parentid='ui-datepicker-div' tag='A' />"

dont know why its not accepting that variable or is there any other way to pass that variable.
Simple i just need to choose the current date or anyother date(which i pass in the variable ex dt=Today.AddDays(1).ToString(“dd”) ) and click that date on the calendar .
Why its so tricky ?

tried .By looking at the error its do accepting the variable.
its 19 date its accepting but its unable to find on the screen .
check this bcz we didn’t choose any screen ?

Sorry i was not clear. Paste your selector which you showed in 1st post.

but aaname="+dt.Trim+"

(no &quot)

DO not know what is creating a problem at your end but you can try this same it is working for me. (10.7 KB)


Hi akshay,

I have done the same .Beside input dialogue box i hv hard coded in the variable.
Though its taking date i hv given in input dialogue but its not clicking that date.
check this i choose 27 its reflecting in aaname but not clicking 27 on calendar. :frowning:

Are you executing Akshay’s code (same website)? Or are you using that activity in your code? If your code, title still says “Online Hotels”

for me everything is working pal . try without idx…

i removed idx still not working.
ok anyway let me try later may be problem with my chrome or laptop.

yes please use IE i have used IE pal. chrome my uipath is not much able to detect ui elements

his code is almost similar as ur and mine ,logic is same. don’t know why its not clicking on the date on the calendar .
Anyway thnx @vvaidya for being there every time and quick response.

Fyi… Mine and Yours, ParentID is different

haha you win pal. indeed.