JMeter Tutorials | 06 | What are Assertions | Types of assertions in Jmeter explained

Learn Automation Online
Learn Automation Online
11.7 هزار بار بازدید - 5 سال پیش - Assertions:  Assertions is nothing but
Assertions:  Assertions is nothing but saying in a very confident manner. In Unit testing, we have used Assertions. Assert equals, assert null, assert not null etc are some famous assertions.

Similarly in Jmeter, to certify something, we can use assertions. HTML assertions, XPath assertions, duration assertion, Response assertions are few of them.

In this video, we are going to learn about the assertion options available in Jmeter. Below are the notes which can be useful for you.

Response Assertions: As a result of the HTTP request, we will get a response. As seen in the REST API tutorials, the response will have response headers, status codes, status message, the body of the response. In order to validate these things, we can use Response Assertions.
For example, we can assert that the status code is 200 or not, the response message is OK or not and so on. NOTE: suppose you have to check negative scenarios and validate 400 and 500 series response codes. You have to use the Ignore status option. Because Jmeter by default considers 4xx and 5xx series codes as errors.

Size Assertion:  We know that the response will be returned and it will have some bytes as the size. Assume you are a developer of Google, and you have to ensure that even with very slow internet google page should be loaded without any trouble. For this, the size of the home page should be very minimal. Isn't it? To assert this kind of scenario, we can use the size assertion.

Duration Assertion: Consider the above scenario again. In order to certify that our product is working very fine, it should be loaded within seconds right? Which means, we have to ensure that the duration between the request sent, received and acknowledged by the server and the response should take a very minimal amount of time. So to validate that our page is taking very less amount of time to show the response, we can use duration assertion.

HTML Assertion: In order to have less page size and duration. The code of the HTML page should be clean without errors and warnings. In other words, it should be very proper and very minimal, so that the resultant products like page size and the duration can be reduced to a greater extent. To verify the errors in our HTML pages, Jmeter provides us with an option called HTML Assertion. This assertion will report us, the number of errors and warnings. For the detailed report on where the error exactly is, we have to export/write it to a file and we can view it there.

XPath Assertion: This is used to assert the XPath for the given application. Most applications nowadays are Extensible HTML (XHTML), so to verify our XPath, use the tidy parser. Which means it will be tolerant of malformed XML tags.

Watch my other videos:

1)Selenium basics: http://bit.ly/2XtOt1F
2)Selenium Advanced: http://bit.ly/2WYieZe
3)TestNG Absolute Beginner Guide: http://bit.ly/2N6xgaM
4)Data-driven framework: http://bit.ly/2WVjSFT
5)Page Object Model: http://bit.ly/2IAXJZR
6)How to write XPath on our own: http://bit.ly/2KwMLql
7)Must know Java concepts for Selenium: http://bit.ly/31Ro7G8
8)Selenium Interview Questions: http://bit.ly/2N6xu1F
9)Java for Selenium Automation: http://bit.ly/2IylOAh
10)Maven beginner guide: http://bit.ly/2Rsigm0
11)Github Absolute beginner Guide: http://bit.ly/2Kxdzqj
12)REST Web services beginner guide: http://bit.ly/2N69rQq
13)Cucumber absolute beginner guide: http://bit.ly/2X0lSBB
14)Acceptance Testing (Fitnesse) beginner guide: http://bit.ly/2Y6oE55
15)Jenkins beginner guide: http://bit.ly/2X39fGb

#PerformanceTesting #JMeter #LAO #Tamil
5 سال پیش در تاریخ 1398/04/04 منتشر شده است.
11,784 بـار بازدید شده
... بیشتر