Collections:
Assertion on Home Page Response Data
How to verify if I am getting the home page HTTP response data correctly?
✍: FYIcenter.com
You can add several Response Assertions to the HTTP request
to very if you are getting the home page HTTP response data correctly or not
as shown in this tutorial.
1. Start JMeter on your computer and open "\fyicenter\Facebook-Login-Test.jmx".
2. Add another HTTP Request sampler call "GET SSL Home Page" under the "Login Test Case" with these settings:
Name: GET SSL Home Page Server Name: www.facebook.com Protocol: https
3. Right-click on the "GET SSL Home Page" HTTP Request sampler, and select "Add > Assertion > Response Assertion". You see the "Response Assertion" settings screen.
4. Modify the following settings:
Name: Status Code 200 Apply to: Main sample and sub-samples Field to Test: Response Code Pattern Matching Rules: Matches Patterns to Test: 200
5. Add another "Response Assertion" with the following settings:
Name: Has Login URL Apply to: Main sample and sub-samples Field to Test: Text Response Pattern Matching Rules: Contains Patterns to Test: <a href="/login/" title="Log into Facebook">Log In</a>
6. Add a child "View Result Tree" listener to "GET SSL Home Page".
7. Click "File > Save Test Plan As" menu and save it as "\fyicenter\Facebook-Login-Test-2.jmx".
8. Click "Run > Start" menu to run the test.
9. Click "View Result Tree" in the left panel to open it. You see the "GET SSL Home Page" test sampler executed successfully. We can assume that it returned the status code 200 and the response contains the login hyper link.
The picture below shows you how to use Response Assertion to verify HTTP request result data:
⇒ Assertion on Home Page Response Time
⇐ HTTP Request to Get Home Page
2019-08-12, 3264🔥, 1💬
Popular Posts:
How to perform UUDecode (Unix-to-Unix Decode)? UUEncode is Unix-to-Unix encoding used on Unix system...
How to generate user full names? Test user names are frequently needed in testing applications that ...
How to set Content-Type to application/json? The server requires the Content-Type to be application/...
How to perform regular expression pattern match with multiple occurrences? To perform a regular expr...
How to valid IP addresses? In order to help your programming or testing tasks, FYIcenter.com has des...