Issue with Selectors

studio

#1

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.


#2

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


#3

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


#4

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


#5

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


#6

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.

Regards.


#7

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:


#8

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

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

#9

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’ />"


#10

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


#11

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