In this video, Mike Smith explains why assertions are needed and shows how to add them to the load test.
- [Instructor] I now need to know…that my results are correct.…Sure, it's easy to see a green tick…and assume that they're correct,…but it's better to have assertions every now and then…to ensure that what you're wanting to happen actually did.…If I click on the view results tree…and select one of the results that came back,…I can see that the response code came back as a 200 OK.…This is good, because if the site were down,…then we'd get a failure.…
But what if I wanted to check another response code…was being sent back through?…What if I wanted to know that a redirect was happening…before the 200 OK?…Adding an assertion lets me be sure…that something is happening that I specify.…This can be positive or negative.…I can add assertions on lots of things…like the context of a site, their response,…the load time, the headers, loads of stuff.…Adding an assertion is simple.…All I need to do is right click…on the step I want the assertion to be associated with.…
In this case it's the HTTP request.…Go to add, go to assertions,…
- What is load testing and why do we do it?
- Creating and running load tests
- Improving a test by adding timers and assertions
- Running your load test through the CLI
- Saving CLI results to a .jtl file
- Importing a .jtl file to JMeter graphs
- Creating an HTML dashboard at CLI runtime