0
votes

I am using JMeter to performance test an address validation service that finds valid addresses for an insurance quoting application. I am testing this from the back end using soap requests and I have a csv data config file with a large number of search strings.

In order to get a true idea of the performance of this service, I need to test with a large number of addresses i.e. over 30000 so that the server caching doesn't affect my performance results. I have a list of addresses in a csv spreadsheet but some of them cause failures for whatever reason (e.g. the address no longer exists, I have verified this when just submitting one request with the address in question). I want to remove all addresses that fail from my csv file.
So I wanted to use JMeter to print the search address to the console if the request with this particular search address fails. I tried to use an IF controller with this as the condition "${JMeterThread.last_sample_ok}" == "false" and the following in the name section so that it prints the address to the JMeter console. The parameter searchAddress comes from my CSV input file. When I try and run this it just prints ${searchAddress} to the console. So the if statement works but it doesn't recognise searchAddress as a variable.

If I can get this to work I would copy all the search strings to excel and use a formula to remove them from my list of addresses to be used by my JMeter thread.

Sorry for the lengthy question, but hope I have explained my issue clearly.

1
To try and state this simply. I need to print the value of a variable being read from a csv input file to the console if the value causes the soap request to fail. - chucknor
Looks like you've incorrectly set up your CSV Data Set Config. What's in jmeter.log / Options > Log Viewer? Are the values correctly extracted from csv-file? Can you get the extracted values from ${searchAddress} via e.g. Debug Sampler? Is csv-file accessible for CSV Data Set Config (is the path to the file set correctly)? - Aliaksandr Belik
Hi Alies. Thanks for that. Yep the values are available using a Debug sampler. I just added a Debug sampler under my IF controller with this in the name section 'vp - ${__time(HH:mm:ss)} ${__time(HH:mm:ss)} ${__logn(${searchAddress},OUT)}${__logn(${searchAddress},INFO)}'. Question answered. Thanks a lot. - chucknor

1 Answers

0
votes

An alternative is to use a BeanShell PostProcessor as child of which ever component receives the error; In the Beanshell, something like:

String searchAddr = vars.get("searchAddress");

//Output to Console
System.out.println("Failed Address = " + searchAddr);

//Output to Log file etc.
log.info("Failed Address = " + searchAddr);