Getting an error that invalid substitution in field, while trying to specify the value in xPath using a variable.
getInnerText session ://td/table/tbody/tr[contains(td[2],$ctlr_ip)]/td[6];
See the attached screenshot for the exact error.
Getting an error that invalid substitution in field, while trying to specify the value in xPath using a variable.
getInnerText session ://td/table/tbody/tr[contains(td[2],$ctlr_ip)]/td[6];
See the attached screenshot for the exact error.
The problem here is that the square brackets in the xpath is being interpreted as a substitution command. So you need to escape those brackets:
//td/table/tbody/tr\[contains(td\[2\],$ctlr_ip)\]/td\[6\]
If the escaping rules are confusing, another option is to concatenate different portions that allow or disallow substitutions (because of braces). Note that you can only inhibit substitution on an argument to a substitution command.
[string concat {//td/table/tbody/tr[contains(td[2],} $ctlr_ip {]/td[6]}]
No one has followed this question yet.