I want to iterate over a set of table rows from an html response (for example, each row contains data that I want to use in another query). To do this, I set up a variable called COUNTER, and I installed XPath Extractor with the XPath Query field set to
//table//tr[${COUNTER}]/td[0]
However, this does not allow to obtain a result regardless of the value of COUNTER. If I replaced $ {COUNTER} with a numeric value, for example.
//table//tr[4]/td[0]
works as expected.
The following error indicates that this functionality should be in 2.5.1 https://issues.apache.org/bugzilla/show_bug.cgi?id=51885 , but it does not work for me in 2.5.1 or 2.6
Using variables in XPath expressions should be very useful in jmeter, but I can not find any talk about how to do this on the Internet. I am open to alternative suggestions, but regular expressions do not immediately seem to be the right solution.
Chris
source share