How to pass variable into selector

selector
uiautomation

#1

Hi,

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 .


Date Picker Selection issue
Selecting calendar date on website
datascrapping:Selector issue
How to copy an Image of a name as Text?
Cloning
How to select a date using date time picker control?
#2

This is from my code

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

UI recording and play back issues
#3

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


#4

Paste the syntax error you are getting


#6

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


#7

Probably tablerow is varying as well


#8


#9

Do this way:

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

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


How to click the detial according to text?
#10

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 ?
:stuck_out_tongue:


#11

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 ?


#12

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

but aaname="+dt.Trim+"

(no &quot)


#13

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

Regards…!!
Aksh


#14

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:


#15

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”


#16

for me everything is working pal . try without idx…


#17

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


#18

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


#19

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.
:slight_smile:


#20

Fyi… Mine and Yours, ParentID is different


#21

haha you win pal. indeed.