question

ramarb avatar image
ramarb asked ericnute edited

Variable substitution in XPATH query

I was trying to get a column's value as given below which does not work. I have checked variable substitution option in Extractor Properties.

 

swing/table/row\[cell='${ipadd}'\]/cell[8]

 

and, how to introduce backslash substitutions for the command:

 

swing/table/row[cell='[query BTS_data col2(3)]']/cell[8]   (Getting cell value from another query here)

iTestxpath
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
ramarb avatar image
ramarb answered ramarb posted

Ah! Interestingly, when I substitute variable for the last cell, it works fine!

 

swing/table/row/\[cell='${ipadd}'\]/cell\[${stby}\]

1 comment
10 |950

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

PreetS avatar image PreetS commented ·

The reason why swing/table/row\[cell='${ipadd}'\]/cell[8] failed was because you did not escape the square brackts for the last cell

swing/table/row\[cell='${ipadd}'\]/cell\[8\] would do the trick. 

 

When you added the substitution the the last cell, you added the escape character, and it worked. 

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.