Вы находитесь на странице: 1из 7

Assertion

Home / JMeter

November 6, 2016 JMeter By Rida Sattar

JMeter Tutorial

JMeter SetUp

JMeter Basics

Build JMeter Test Plan

Elements of Test Plan

Assertion in JMeter is used to validate response of the request, that you have sent to the server. Assertion is a process where you
verify expected result with the actual result of the request at run time. If you need to apply assertion on a particular Sampler, then add it
as a child of that Sampler.

You can view assertion results by adding “Assertion Listener” to the Thread Group. Failed assertions will be displayed in other listeners
as well.

List of Assertions are as follows:

BeanShell Assertion
BSF Assertion
Compare Assertion
Duration Assertion
HTML Assertion
JSR223 Assertion
MD5Hex Assertion
Response Assertion
Size Assertion
SMIME Assertion
XML Assertion
XML Schema Assertion
XPath Assertion
Let’s have a look on some common types of Assertions:

1: Response Assertion:
Response Assertion can be used to add and compare pattern strings against one or many values of server response. For Example,
when you send a request to the URL: https://www.google.com and get the server response. Here, you can verify this response by using
Response Assertion. You can insert “<title>Google</title>” as a “Pattern to Test” field value in Response Assertion. If response doesn’t
contain this string, it will fail the sampler.

1. Add the pattern string according to your expected response

2: Size Assertion
Size Assertion is used to verify the server response contains expected number of Bytes or not.
1. Select Response Size Field to Test
2. Enter expected response size in bytes
3. Choose type of comparison

3: Duration Assertion
Duration Assertion is used to verify that server response is received within a specified time constraint or not. It will mark the sample
request as failed, if response takes longer time duration than the given amount of time.

1. Enter duration period of response in milliseconds

4: XML Assertion
XML Assertion is used to verify that the server response data comprises of a correct XML document or not.

5: HTML Assertion
HTML Assertion is used to verify that the response contains correct HTML syntax or not using JTidy (HTML Syntax Checker). It will fail
the test in case of improper HTML syntax response.

For more updates on JMeter, please Subscribe to our Newsletter.



Please ask any questions on ForumsQA, in case of any issues or doubts.

JMeter

Share this post

About the author

Rida Sattar

My name is Rida Sattar. As a technical-savvy, I have more than 3 years of experience in Software testing and Selenium automation.
Currently I am working as a Senior QA Automation Engineer for an IT company in Karachi, Pakistan. I always love to put myself in new
challenges and break software from different angles. I have passion for automation and performance testing. I always try to share my
ideas and knowledge with the community because I believe in this quote: “Knowledge has no value unless you use and share it.”

Related posts

Test Plan Elements


September 24, 2018

Getting Familiar with JMeter GUI


July 19, 2018

How to Install JMeter?


July 4, 2018
How to Install Java on Mac OS?
July 4, 2018

Introduction to JMeter
June 21, 2018

Logic Controller
November 6, 2016

SUBSCRIBE TO NEWSLETTER

Enter your email address:

Subscribe

GOT SELENIUM PROBLEMS ?

RECENT POST

What is TestNG?

WebDriverManager

Test Plan Elements


Generate Newman Reports on Jenkins

Run Postman Collection on Jenkins

Getting Started with Cucumber BDD for Testing in Agile Teams

Using XPath Generator for test recording in Katalon Studio

Configure Jenkins Job to Run Batch Command

Postman with Newman & Jenkins

API Testing with Postman

Install Jenkins

SQL Table Commands

Newman Optional Parameters & Configurations

Trees

Queuing for Beginners

Got a Question?

Subscribe in a reader

Site Links

Selenium Training
Corporate Training
Video Tutorials
About Us
Guest Blogs
Testimonials
Contact Us
SITEMAP
Tutorials

Software Testing

Selenium - Java

Selenium - C#

Cucumber

SpecFlow

Appium

TestNg

JUnit

Maven

Java

Postman

Katalon

Author

I’M LAKSHAY SHARMA AND I’M A TEST AUTOMATION ENGINEER.

Have passed 11 years playing with automation in mammoth projects like O2 (UK), Sprint (US), TD Bank (CA), Canadian Tire
(CA), NHS (UK) & ASOS(UK).
Currently I am working with BLOOMREACH as SDET.

I am passionate about designing Automation Frameworks that are effective and easy to maintain. For automating websites my
weapons are QTP and Selenium (Webdriver). I live in Amsterdam(NL), with my wife and a lovely daughter.

Please connect with me at LinkedIn or follow me on Instagram.

© 2013-2018 TOOLSQA.COM | ALL RIGHTS RESERVED

Вам также может понравиться