Adding variables to selectors

Scenario: adding variables to selectors.

Steps to reproduce: NA

Current Behavior: Not identifying the UI element when added variable to selectors.

Expected Behavior: It should identify the element based on the variable provided in the selector.

Studio/Robot/Orchestrator Version: Studio and community. Tried in both.

Last stable behavior:
Last stable version:
OS Version: Win 10
Others if Relevant: (workflow, logs, .net version, service pack, etc):

Kindly paste the pattern of your selectors ( for multiple logins to make sure its not dynamic) and what you are trying to modify.

example of a selector, where VAR = a string variable which can have the values of the notepad buttons (Help, File…etc)

“”

This is the selector where ‘day’ is a string variable. It works when I give a static value for ‘aaname’. But fails to identify the element when I give the variable.

Did you try replacing “week of July 16 2017” in the title with a wildcard(*)

Make sure there are no spaces in your variable.

Yes. Just tried replacing it with wild cards. Still the same. The spaces before the variable is according to the syntax. If I remove those, it gives a validation error. The input variable is being passed correctly. But somewhere I am missing out on something.

Hi ,
From the screen shot I can see that there is a errro icon at the corner . Could you please put all the selector attributes in single line .

PS: this might be silly thing to ask ,do you mind changing variable name other than “day” and try :blush:

Yes. I just put it in two lines to take a screenshot. While executing,it is in one line.

Does the name of the variable really matter ??

Oh cool.
Na variable doesn’t matter. :slight_smile:
Please check this out ,this selector works for me.
"<html app='chrome.exe' title='Google Calendar - *' /><webctrl id='dp_0_tbl' tag='TABLE' /><webctrl tag='TD' aaname='"+day+"' />"

adding xaml.Just open google calender before running the file.
calender.xaml (6.7 KB)

It is the same selector I’m using. However, tried running the file. It gives this error. Kinda weird. Its working for you but not me… !

Strange :roll_eyes:.
Could you please upload your workflow.

Unfortunately, Its not letting me upload it. " New users cannot upload attachments " :confused:

could you please check whether you can send on private msg.

I see space after wildcard(*) in the title, may be that could be the reason. Try removing the space.

Just an fyi…incase if you are selecting month beginning/end dates, there is a possibility of previous/next month dates visible in the same month calendar, in that case just aaname in the selector will fail as Uipath will create idx values (idx=2 if you have previous month date visible or idx=1 if you have next month date visible).

In below example, 25-28 dates have repeated twice, so just aaname won’t work.

http://d585tldpucybw.cloudfront.net/sfimages/default-source/productsimages/asp.net-ajax/productitemfeatures/calendar_simple-calendar-functions_screenshot-gif.gif?sfvrsn=13a0bc54_1

1 Like

use {{variable}} eg.: webctrl title=‘{{row}}’

webctrl title=‘{{row}}’ tag=‘TD’