Kac
Kac

Reputation: 194

How can I get name and other properties of transaction controller which consist of three requests?

My script structure looks like that:

Transaction Controller SEARCHING OFFERS Transaction

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

Answers (1)

timbre timbre
timbre timbre

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

Related Questions