Issue with Selectors

Hello Guys,

I m trying to pass variable into selector :

My solution : " <webctrl aaname" + myVariable + " tag=‘DIV’ />"

Error msg : "Please make sure you input a syntactically correct selector "

Please guide how i can fix it. I appreciate any help I get from your guys.

You might need the single quote in there too. Look at how it’s =‘DIV’, so just place a single quote on the inside the double quotes.

EDIT: Also, you need the =, like aaname='"+myVariable

I tried it but not working same error still exists :sob:

Try it like this: “<webctrl aaname=‘”+myVariable+“’ tag=‘DIV’ />”

I copy pasted your solution but still getting same error. Not sure what i m doing wrong

Try outputting your selector with a Message Box or Write Line. That’s a good way to verify that you have a legitimate selector, with all the quotes in correct. Then, also use UiExplorer to compare your selector with what is generated through UiPath.


If you still can’t get it to work, please share a screenshot or share your workflow with us so we can have a better look :slight_smile:

1 Like

Its simple three step recording which I did. Just unable to pass variable. Kindly guide.

<?xml version="1.0" encoding="utf-16"?>TrueTrue

Do not use selector editor (don’t click on[…] button)
click on textbox of selector
use end+shift+home and delete
type manually including quotes “<webctrl aaname=‘”+myVariable+“’ tag=‘DIV’ />”

1 Like

solved. I was struggling from couple of days. Thank you for this trick :bowing_man::bowing_man:

Gr8! Instead of selecting old text and delete you can also edit within textbox (not using selector editor). This will also work.

1 Like