Fail to catch XPath in treeview

rpa
issues
xpath
treeview

#1

Hi there,
My test website is some internal network, and RPA runs fine until catch the treeview node.
I catch the XPath from Chrome and it looks quite different: //*[@id="$/shared_disclosure"]

My test codes here:

recording-1508515389311.zip (1.8 KB)


#2

@jason_yuan,

Hi Jason,
The xpath doesn’t work because it contains $ and /. You can avoid the error by putting the xpath in a string variable and then using this variable in the action.


#3

Hi @ashapkina
Still not work. I want to ask do I catch the right xpath?

image


#4

@jason_yuan

The variable name in the xpath is in parentheses. It should be put in curly brackets: ${treeviewxpath}.


#5

@ashapkina
Wow!!! Its the brackets, thank you so much.:heart_eyes:


#6

@jason_yuan
Glad I could help :slight_smile:


#7

Somehow the above solution didn’t work for me. RPA Express didn’t recognized the escaped $. So I’ve come up with a different solution.

In case the attributes contains any invalid symbol you can use the contains() function and specify the attribute tag and contents.

e.g. class="$bold-character"

//span[contains(@class,‘bold-character’)]