Using Variable + WildCard in Selector

Trying to create a variable selector to always click on the person’s name on a webpage.
I have the first name and last name passed in separate variables
I have created a variable to store the entire new selector i’m trying to build, but I’m having some trouble with what the formatting should look like to correctly get the selector to work

variable LAST = user last name
variable FIRST = user first name

ORIGINAL SELECTOR: webctrl aaname=‘Smith, John , Click to edit’ parentid=‘featured’ tag=‘A’ /

SELECTOR USING VARIABLE <webctrl aaname=’’"&LAST&’", ‘"&FIRST&’" * , Click to edit’ parentid=‘featured’ tag=‘A’ />

something is not working where uipath is not able to recognize by selector, and im pretty sure it has to do with the formatting of how im typing in the variable and/or the wildcard…

any help is greatly appreciated.

2 Likes

fine
whenever we mention the variable in a selector it has to be like
aaname = ’ " + variablename + " '

now once after adding this to selector make sure that whole selector is passed as string to the selector property i.e., we should not make changes in the selector editor rather we need to copy that and put in a notepad, add the variable as suggested above and copy the whole selector and paste as a string value between double quotes in the SELECTOR property of the activity wherever we want

the reason is sometimes the selector editor wont take the variable mentioned to the attributes
so its best practice to mention the selector as string between double quotes when variable is passed to it

Cheers @db44

@db44
Here’s my selector for when I used a variable with wildcards. Make sure that you are editing from the Expression Editor and NOT the Selector Editor.
"<webctrl aaname='*" + shipmentNumber + "*' />"

2 Likes

Thanks for both replies, seeing the example helped me to get mine to work, thanks a lot!

2 Likes

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