Defining Transactions and Inserting Assertions in Jmeter

Defining Transactions and Inserting Assertions in Jmeter:

To define transactions in Jmeter we use Simple Controller.
The Simple Logic Controller lets you organize your Samplers and other Logic Controllers. Unlike other Logic Controllers, this controller provides no functionality beyond that of a storage device.
To add Simple Controller, Right Click on Work Bench, click on Add-> Logic Controller -> Simple Controller as shown below


In our application,we have the below transactions:
1.       Welcome Page
2.       Login Page
3.       Reservation Page
4.       Booking Page
5.       Select Page
6.       Purchase Page
7.       Signon Page

Each request which is recorded is kept under each Simple Controller by drag and drop and select Add as Child as shown below:

Follow the above step for all the transactions. The final screenshot after addition of transactions is shown below:

Now let us verify the recorded script. Go to Test Plan and add Thread Group under Test Plan. Copy all the controllers from WorkBench to the Thread Group.

Once we completed the script, we can add Comparison Assertion Visualizer and verify the correctness of the script as shown below:


To verify that the page is properly loaded or not. Verifications like Text verification is checked by using Assertion in Jmeter.

We need to add an assertion in Jmeter to check for particular text on the page. To do this we add Response Assertion as below:

Right click on the HTTP Request and Click on Add->Assertions->Response Assertion.  Response Assertion opens the below page:

Click on Add and Add the text in the Patterns to Test.
For E.g. We can add “Flight Details” to verify on the page.

We can check the Success or Failure of Assertion as below:

Green shows the requests passed and Red shows that the request is failed.


Comments

Post a Comment

Popular posts from this blog

Steps to Analyze AWR Report in Oracle

Vmstat Output explained

Verifications and Error Handling in LoadRunner *Web_reg_find and Web_reg_save_param*