In Robot Framework, I want to reference the value of a variable, I had set earlier. But when I reference the value by:
xpath= //*[text()=\${uid}]
I do not get the value of the variable uid but instead, I get an error
InvalidSelectorException: Message: invalid selector:
Unable to locate an element with the xpath expression //*[text()=${uid}] because of the following error:
SyntaxError: Failed to execute 'evaluate' on 'Document':
The string '//*[text()=${uid}]' is not a valid XPath expression.
It just takes the uid
as the part of the XPath instead of referencing it. As you can see, I tried to escape the $
sign by adding a backslash (\
), but it doesn't do anything. It is not even shown in the expression shown in the error.
If anyone has any solution, kindly share them.