Passing Var into selector of Get Element but not identifying UIElement

Hello Everyone,

I’m passing a variable in the selector to dynamically identify and click on a candidate’s name on a website. The variable name is “Candidate”, which is a loop item from a For Each list of string items.

In each iteration, the Candidate variable is getting the correct value, but when it’s assigned to the selector, it neither highlights the element on the screen nor throws any error. It also doesn’t enter the Get Element activity sequence to perform the click.

Can someone please help me understand why this is happening? I’ve attached a reference picture to explain the complete scenario.

you need to escape the string … add " or ` around the variable

"{{Candidate}}"

Writting Xpath in this way is working properly:
“xpath”: “//span[contains(text(),‘{{Candidate}}’)]”

Thank you @Allan_Zimmermann

1 Like