Duration assertion is used to assert the answer fourth dimension of asking inward jmeter software charge exam plan. It volition assert that answer of asking is received inside given amount of fourth dimension or not. If answer of asking is received inward given amount of fourth dimension thence it volition hold upward popular off too if it exceeds given amount of fourth dimension thence it volition hold upward fail. Let's larn how to role duration assertion inward jmeter software charge exam plan.
Add Duration Assertion In Software Load Test Plan
You tin hand the axe add together duration assertion parallel to asking or nether asking of your software charge exam plan. To add together it nether request,
- Right click on asking -> Add -> Select Assertions -> Duration Assertion. Please aspect inward to the bellow given image.
It volition add together duration assertion nether selected request.
Example : Assert Response Time of Request Using Duration Assertion
I produce got prepared uncomplicated example to tech you lot role of duration assertion inward jmeter software charge exam plan. Test innovation config is every bit bellow.
- I produce got added ii HTTP request.
- Under each request, Added Duration Assertion and Assertion Results.
- 1st request's Duration Assertion : Set Duration inward milliseconds = 200
- 2nd request's Duration Assertion : Set Duration inward milliseconds = 5000
- Thread Group Config : Number of Threads = 1, Ramp upward menses = 1, Loop count = 1.
- Added persuasion outcome inward tree listener nether thread group.
You tin hand the axe meet that duration inward milliseconds = 200 for 1st duration assertion too duration inward milliseconds = 5000 for 2nd duration assertion.
Now when you lot operate higher upward sample software charge exam plan, outcome of 1st duration assertion volition looks similar bellow.
You tin hand the axe meet inward outcome that asking has taken 1274 milliseconds to consummate which is greater than expected 200 milliseconds thence assertion is failed. 2nd assertion is popular off every bit nosotros laid duration inward milliseconds = 5000.
This means you lot tin hand the axe role duration assertion inward your software charge exam innovation to assert fourth dimension duration of request.