JMeter extends the useful capability to extract response data into user variables. In a recent post, we covered how to use the Page Data Extractor to find and save data metrics returned in the body of the page for use in post-processor scripts and other test plan elements. It is a reasonable requirement to see if such extractions are successful before proceeding to this other test logic, which can be achieved manually in your scripts. However, in this post we will review how to use the Extractor Success Assertion component to automatically check if an extractor successfully returned data from the request.
Adding the Extractor Success Assertion
The Extractor Success Assertion plugin must be added to JMeter via the Plugins Manager, which can be found under the “Options” menu. Installing the plugin for the first time will require a restart of JMeter:
Configuring the Extractor Success Assertion
It is recommended per the documentation that the Extractor Success Assertion is added as a top-level component in your test plan:
A single instance of this component can be used for all extractors in your test. It accepts a comma-separated list of extractor variable names, as shown below where we have specified “MY_VARIABLE
” as a configured option:
Upon execution, this assertion will serve to fail the current iteration of the test plan in the event that an extractor fails to capture any of the specified user variables. Using this component, your test results can be assured free of spurious results due to extractors that fail to capture their intended targets, without the need to code checks for each of these variables individually in your post-processor scripts.
Did you know that RedLine13 offers a full-featured, time-limited free trial? Sign up now, and start testing today!