Blazemeter / CorrelationRecorder

A repository for the Auto Correlation Recorder Plugin for JMeter
https://blazemeter.github.io/CorrelationRecorder/
Apache License 2.0
26 stars 14 forks source link

Add Automatic Correlation based on assertions #55

Closed fbaptista closed 9 months ago

fbaptista commented 9 months ago

Describe the feature

Currently, the automatic correlation recorder autodetects correlations based on http code status error. A lot of applications, do not show 4xx or 5xx status code to the user, but instead sends 2xx status code with an error description in the response. This scenarios make the plugin useless.

It would be very useful to provide auto-correlation capabilities based on user defined assertions, so that applications that do not send error status code to the users can be correlated also.

3dgiordano commented 9 months ago

Hi @fbaptista

This is already supported and used in recording HTTP requests in JMeter.

Simply incorporate into the test plan the assertions before starting recording that cause the orders from that platform to return with errors and force the status code to be rewritten to a valid code (500 or 400 family). You can use the type of assertion that you think is necessary, depending on the framework and the way of processing requests, some require having a particular parsing of the responses, for those cases you can use scripted assertions to have greater control of the message.

With these assertions in Testplan, the Automatic Rule Correlation (ACR) method or the method based on existing rules will detect when there is an error (originally incorrectly reported by the framework) and will allow you to automatically correlate everything that is really an error.

This trick comes from the JMeter HTTP recorder or for the JMeter playback, where it is also used to capture and generate the execution results with the most appropriate status code so that they are reflected as executions with errors and not in status 200 when they really are a mistake.

Whenever you have these frameworks that generate error responses without reflecting the error in the http state, you must create assertions that make these errors evident so that JMeter can count them as such.