Search code examples
jmeterperformance-testingload-testing

What is the purpose of doing post processor in jmeter?


In which scenario we'll be using this post processor in jmeter? and what is the main purpose of using it?


Solution

  • Consider a login scenario in which we send a login HTTP request. Suppose that there is parameter in the response of this request and we want to extract and use this parameter later on. So in this case we will need Post-processor (regular expression extractor). It is most commonly used post-processor in JMeter.

    Similarly, if we want to run some java code after any specific sampler (request) then we can add bean-shell post-processor under our sampler. For example we extracted a value from response and now we want to multiply it by 2. So we will first add a post-processor regular expression extractor and next we will add bean-shell post-processor.

    Official JMeter documentation mentions that Post Processors are applied after samplers. They are applied to all the samplers in the same scope, so to ensure that a post-processor is applied only to a particular sampler, add it as a child of the sampler.

    Check this question for example of Post-processor Extractor: How to Fetch or extract value from Div tag using Jmeter