Reputation: 194
My script structure looks like that:
Transaction Controller SEARCHING OFFERS Transaction
http request offers
http request offers details
Beanshell PostProcessor
Which BeanShell command let me to get name, response code, response time, test result and test time for whole transaction?
Where I should attach BeanShell PostProcessor? Which code I should use, but in my opinion
String name = sampler.getName();
doesn't work correctly for me.
Upvotes: 0
Views: 1757
Reputation: 13986
IMO you should be using BeanShell Listener instead of Beanshell PostProcessor. Listener can be at the same place where your current Beanshell PostProcessor is. That object has access to sampleResult
, which would contain response code / response time / etc, for example:
sampleResult.getSampleLabel(); // the name, e.g. 'SEARCHING OFFERS Transaction'
Full list of SampleResult functions is here If you only want to process transactions in this listener, you could filter them (e.g. by name).
Upvotes: 2