posthyperlinkjmeterpreprocessorpost-processor

JMeter: Application of Pre-Processor and Post-Processor


I would like to know the Application of Pre-Processor and Post-Processor in JMeter.


Solution

  • As name suggests these components are used to process something (request, response, custom operations) before and after the sampler (request).

    Pre processors :

    These components are used before the request to perform custom actions.

    Ex: Suppose If I want to add something to request before sending it to server then preprocessor is added. For example if could be fetching some information from DB or Regex operations. Thus after performing those operation we can pass results of these actions to request. Thus we can modify/update request or request parameters before sending request to server.

    Post processors : These components are used after the response of request has arrived to perform custom actions.

    Ex: Suppose If I have asked for something on google and I want to find out something from response for below actions,

    1. To validate response
    2. Extract something and process to pass data to next request
    3. Perform custom actions like DB operations, file operations etc.

    Then post processors can be used.

    See above snapshot, enter image description here

    Components pointed by arrow will be executed before request is sent to server and components within square will be executed after response has arrived.

    I hope this was helpful.