You need the following:
- Extract
matchType
response values and store them to JMeter Variables - Write these variables to CSV file
For point 1 I'd suggest to use XPath Extractor post processor.
Relevant Xpath expression would be
//ns2:AddressResponse/AddressResponseDetails/location/matchType/text()
After that you'll need to write the output to a file. The best option is to use Beanshell Post Processor
Assuming that you used matchType
variable in XPath Extractor you should get something like
matchType=building
matchType_1=building
matchType_2=street
matchType_matchNr=2
All above are JMeter variables.
So following Beanshell code should do the trick for you:
FileOutputStream out = new FileOutputStream("myfile.csv",true);
StringBuilder sb = new StringBuilder();
int matchCount = Integer.parseInt(vars.get("matchType_matchNr"));
sb.append("10 Main Street");
sb.append(",");
for (int i=1;i<=matchCount; i++)
{
sb.append(vars.get("matchType_" + i));
sb.append(",");
}
sb.append(System.getProperty("line.separator"));
out.write(sb.toString().getBytes("UTF-8"));
out.flush();
out.close();
Hope this helps