Adding variables to selectors

p_notaproblem
p_solved

#1

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):


#2

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


#3

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


#4

“”

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.


#6

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

Make sure there are no spaces in your variable.


#7

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.


#8

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:


#9

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


#10

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)


#11

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… !


#12

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


#13

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


#14

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


#15

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