Introduction to Duration Assertion of Jmeter's Common Assertions

Duration Assertion: assertion duration.
Assertion duration is usually used for performance testing, and is generally used to check whether the response time of HTTP requests exceeds the expected value . And this response time is a performance indicator that is often concerned about in performance testing.

1. Add assertion method

As needed, assertions can be added under [Test Plan], [Thread Group], and [Thread Request], generally under the corresponding [Thread Request], as shown in the figure below, which is what this article introduces.
Add path: [Thread Request - Right Click - Add - Assertion - Assertion Duration]
insert image description here

2. Assertion duration

2.1.Apply to: The scope of the assertion.
1. Usually use the default [Main sample only] (for example, if you add an assertion to an HTTP request and select Main sample only, then the scope of this assertion is only for this HTTP request), and there is no in-depth research on other scopes.
2. The scenarios of [Main sample and sub-samples] and [Sub-samples only] scopes are: some requests will trigger multiple threads at one time.
**【Main sample and sub-samples】** works on the main thread and sub-threads,
**【Sub-sample only】** only works on sub-threads.
If [Main sample and sub-samples] is selected, even if the main thread succeeds, but the sub-thread fails, the assertion will fail as a result.

2.2. Assertion duration
Determine whether the response time of the request exceeds the expected value
(<= expected value - assertion success)
( > expected value - assertion failure)
Set the conversion of the unit that needs attention, here is: milliseconds
insert image description here

3. Assertion result view

Note : All the assertion result error information of all requests under the entire test plan will be displayed under the [View Result Tree] component and [Assertion Result]
component
. -Listener-View Result Tree]
insert image description here
3.2. [Assertion Result] component
Add path: [Test Plan-Right Click-Add-Listener-Assertion Result]
insert image description here

Guess you like

Origin blog.csdn.net/weixin_37600187/article/details/129854966