I have following data in XML response in JMeter:
<details>
<srNo>1</srNo>
<key>123</key>
<Name>Inspector</piName>
<age>89</age>
<country>India</country>
</details>
....................................
...................................
<details>
<srNo>1</srNo>
<key>123</key>
<Name>Inspector</piName>
<age>89</age>
<country>America</country>
</details>
suppose I have n number of such data, from the response of the XML file. I want to read value of "key". for eg. 1 I have to read "1" and store in a variable.
For 1 such response i am reading it in XPath extractor and getting the correct value, but now I have to loop through it to get specified amount of key value in a variable. Suppose if I want 1000 such keys then I have to loop till 1000 times to get all the value in variables.
After getting that value in variables I have to used that value in another Sampler
for eg: ${key1}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…