Sai Matam and
Jagdeep Jain
Sai Matam
Pleasonton, California, USA
Jagdeep Jain
Dewas, Madhya Pradesh, India
Any source code or other supplementary material referenced by the author in this book is available to readers on GitHub via the book’s product page, located at www.apress.com/978-1-4842-2960-6 . For more detailed information, please visit http://www.apress.com/source-code .
ISBN 978-1-4842-2960-6
e-ISBN 978-1-4842-2961-3
https://doi.org/10.1007/978-1-4842-2961-3
Library of Congress Control Number: 2017951240
© Sai Matam and Jagdeep Jain 2017
This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed.
Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of publication, neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or omissions that may be made. The publisher makes no warranty, express or implied, with respect to the material contained herein.
Printed on acid-free paper
I dedicate this book to my wife, Jyothi, for inspiration, support, and for single-handedly running around kids and various chores while I tapped at the keyboard.
—Sai Matam
I dedicate this book to my parents, who always motivated me to do things differently, and to my sisters and my wife; without their support, I would not be able to manage a tight schedule on and off work.
—Jagdeep Jain
This book is intended to get beginners up and running with performance testing using JMeter. This book provides step-by-step guidance and covers advanced topics for the experienced engineer. Each chapter is clearly marked with the topics it covers, thereby allowing the reader to skip chapters if appropriate.
Chapter 1 is the foundation of the book where we discuss why performance testing is needed and why we should user JMeter.
Chapter 2 is general-purpose chapter that covers the performance testing methodology.
Chapters 3 through 5 cover specific topics in JMeter (test plan, thread group, pre-processors, controller, timers, sampler, assertions, listeners, post-processors, properties, and variables). By going through these chapters, you will gain an understanding on how to user JMeter for your performance needs.
Chapters 6 through 10 deal with distributed testing, a few advance concepts of JMeter, and troubleshooting tips that will be useful in some projects.
Chapter 11 contains the case study of a sample web application called Digital Toys Inc. This chapter contains everything that a performance testing engineer needs to start performance testing a project.
Chapter 12 shows you how to generate a performance dashboard while executing test scripts.
Chapters 13 and 14 help in setting up JMeter and sample web applications to run the test scripts.
Architects, engineers, and quality assurance professionals will greatly benefit by reading this book. Project managers or other non-technical team members may want to glance through the book and read Chapter 2 , “Performance Testing Primer,” to gain some understanding on performance testing in general.
We have developed an e-commerce web application for a hypothetical company called Digital Toys Inc., for the express purpose of illustrating the example test scripts in this book. Chapter 14 explains how to set up this sample application.
Test scripts developed in this book are hosted on GitHub. Any source code or other supplementary material referenced by the authors in this book is available to readers on GitHub via the book’s product page, located at www.apress.com/978-1-4842-2960-6 . For more detailed information, visit http://www.apress.com/source-code .
For any quires or valuable feedback, feel free to get in touch with authors over e-mail:
Sai Matam at [email protected] .
Jagdeep Jain at [email protected] .
We want to thank the following people who have helped us make sure that the book is useful by providing timely feedback on our chapters, testing JMeter scripts, and finding bugs in our sample web application. Without them, it would have been tough to create a good quality book.
Ai Yu, Alap Shah, Amit Devgan, Anand Sinha, Anil Ramesh Malleboyina, Anil Wadghule, Beejal Vibhakar, Belal Ansari, Bhushan Gupta, Chakradhar Kommera, Charan Das Thota, David Livingstone Gangarapu, Deepa Mahendraker, Dheeraj Sah, Etender Naini, Ganesh Somaka, Gomtesh Gandhi, Govardhan Aliseri, Haridev Vengateri, Harshad Savot, Harshvardhan Vipat, Hemanth Presingu, Mangesh Lunawat, Manjula Gundugollu, Manjula Kavadi, Manohar Gone, Nikhil Agrawal, Nitish Shirsath, Pankaj Saraf, Piyush Singh, Prashanth Abbagani, Prasoon Kumar, Raj Gopal Marripalli, Rama Gangadhar Mekala, Ram Katru, Roshan Iqbal, Ruth Rajitha Gangarapu, Sanjeev Kumar, Satish Salandri, Satyapal Reddy Panyala, Sharon Annese, Shravan Goli, Shyam Palleti, Shyam Palreddy, Sridhar Throvagunta, Srikanth Ganapavarapu, Srinivas Nagandla, Srinivas Reddy Gaddam, Sudeep Tripathy, Suneeta Donepudi, Sunil Kumar, Sunil Potti, Swamy Das, Tapan Upadhyay, Tarak Joshi, Vidhut Singh, Vijay Pasupuleti, Yogesh Sharma and Yogesh Yadhav.
We are very thankful to the editorial team at Apress and the technical reviewer for having various checkpoints in place and providing us with useful feedback in a timely manner, all of which have made this book more useful for readers.
Sai Matam has more than 20 years of diverse experience in software development, including significant experience in performance testing and tuning. He has worked on tuning Java and web applications with many millions of page visits.
Jagdeep Jain has more than a decade of experience in software quality assurance and testing. He holds a degree in Computer Science and Engineering. He is a firm believer and advocate of test automation, and he has used Apache JMeter extensively.
Nitesh Kumar Jain has over a decade of experience in the software testing world. He has an M.Tech in Information technology from IIITM Gwalior and a B.E. in Computer Science and Engineering. He is a keen technology learner with an “let’s automate everything” attitude. He is also an ISTQB certified test manager, technical test analyst, test analyst, and Agile test engineer and loves to make Java-Swing based tools that can help with software testing. He also spent five years on performance testing and test automation.
18.218.228.99