Tuesday, 25 February 2014

Having issues on parametizing XPath values

Problem detailam working on a True Client Script and we are having issues to change the value used on <//span[text()="ltuser126"]>.

I was able to use the Param=LR.getParam("Value");instruction on some other places but I also need to make the "ltuser126" value changing on each iteration.

Please suggest on how to use a parameter value for XPath codes.

Just for your reference if I change the value for any other, for example: <//span[text()="ltuser55"]> the script works as expected.

Problem SolutionResolution in order to handle parametizing XPath values:
Added JS code below:

var test="(//span[text()=\""+ArgsContext.LR.getParam("UserNameParam")+"\"])[2]"

Script replays without error

check journal for more information.