- Logic Controllers (Looping, Conditions)
- Assertion Validations etc
|Number of Users||1|
|No of times Iteration/User||1|
|Page Request Criteria per User||
Creating Test PlanLet’s first understand what kind of Assertions and page request criteria/user we are going to create in this test plan.
AssertionWe are going to add Response Assertion (Assertion component) and Duration Assertion for certain request, here Response Assertion is used to check if the page response has certain expected value, whereas Duration Assertion is to tell whether the given page loads within expected time frame.
Page Request Criteria per userWe have a criteria here that, we need to execute home page only once for a given user, but need to execute all other subsequent request for 5 times. Which means, we need to create Logic controllers. Let’s start creating the plan, but here I am not going to go each and every aspect one by one, rather I can show the complete detail in one shot as shown below
Let’s start exploring the above plan in detail.
Loop ControllerThe purpose of Loop Controller (Logic Controller) is to loop single or multiple requests for given amount of time. As we have the criteria to execute all request (except home page) for 5 times, I am adding a Loop Controller, with Loop count as 5.
Once Only ControllerThe purpose of Once only controller is to execute any given request ONLY ONCE even if it is under a loop controller, which satisfies our criteria of home page.
Response AssertionI am checking the download page if its title has Download in the page using Response Assertion as shown below
Duration AssertionI wanted to check if the download page is loading with certain time frame as shown below
Assertion ResultsI would like to see the result of all the Assertions I have added in the pages, hence we need to add Assertion Result Listener.
ReportsFinally lets execute the test and check the reports for the two new criteria we added in our Test plan
As you can see above there was no problem with Response assertion, since the title was download, but the Duration assertion failed in 4 request except only one request as highlighted above, which means the page loading time is slow than we expected.
Page Request Criteria per userWe need to execute all page 5 times except home page, lets see that in View Result Tree Listener as shown below
As you can see above, home page executed only once, but all other requests executed for 5 times. Note that Docs request passed only once and failed 4 times due to Duration Assertion failure, which is also listed in the view result tree.
Bonus TopicI tried to put the Loop controller within Simple Controller and tried to execute the same test (Since as we know simple controller is just to group multiple requests of same type) but the end result was astonishing, the loop controller was not working within Simple controller, instead of executing requests for 5 times, it executed only once.