Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Performance Testing with JMeter, 2nd Edition
Performance Testing with JMeter, 2nd Edition

Performance Testing with JMeter, 2nd Edition: Test web applications using Apache JMeter with practical, hands-on examples

eBook
R$80 R$196.99
Paperback
R$245.99
Subscription
Free Trial
Renews at R$50p/m

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
Table of content icon View table of contents Preview book icon Preview Book

Performance Testing with JMeter, 2nd Edition

Chapter 2. Recording Your First Test

JMeter comes with a built-in test script recorder, also referred to as a proxy server (http://en.wikipedia.org/wiki/Proxy_server), to aid you in recording test plans. The test script recorder, once configured, watches your actions as you perform operations on a website, creates test sample objects for them, and eventually stores them in your test plan, which is a JMX file. In addition, JMeter gives you the option to create test plans manually, but this is mostly impractical for recording nontrivial testing scenarios. You will save a whole lot of time using the proxy recorder, as you will be seeing in a bit.

So without further ado, let's record our first test! For this, we will record the browsing of JMeter's own official website as a user will normally do. For the proxy server to be able to watch your actions, it will need to be configured. This entails two steps:

  1. Setting up the HTTP(S) Test Script Recorder within JMeter.
  2. Setting the...

Configuring the JMeter HTTP(S) Test Script Recorder

The first step is to configure the proxy server in JMeter. To do this, we perform the following steps:

  1. Start JMeter.
  2. Add a thread group, as follows:
  3. Right-click on Test Plan and navigate to Add | Threads (User) | Thread Group.
  4. Add the HTTP(S) Test Script Recorder element, as follows:
  5. Right-click on WorkBench and navigate to Add | Non-Test Elements | HTTP(S) Test Script Recorder.
  6. Change the port to 7000 (1) (under Global Settings).
  7. You can use a different port, if you choose to. What is important is to choose a port that is not currently used by an existing process on the machine. The default is 8080.
  8. Under the Test plan content section, choose the option Test Plan > Thread Group (2) from the Target Controller drop-down.
  9. This allows the recorded actions to be targeted to the thread group we created in step 2.
  10. Under the Test plan content section, choose the option Put each group in a new transaction controller (3) from the Grouping drop-down.
  11. This...

Setting up your browser to use the proxy server

There are several ways to set up the browser of your choice to use the proxy server. We'll go over two of the most common ways, starting with my personal favorite, which is using a browser extension.

Using a browser extension

Google Chrome and Firefox have vibrant browser plugin ecosystems that allow you to extend the capabilities of your browser with each plugin that you choose. For setting up a proxy, I really like FoxyProxy (http://getfoxyproxy.org/). It is a neat add-on to the browser that allows you to set up various proxy settings and toggle between them on the fly without having to mess around with setting systems on the machine. It really makes the work hassle free. Thankfully, FoxyProxy has a plugin for Internet Explorer, Chrome, and Firefox. If you are using any of these, you are lucky! Go ahead and grab it!

Changing the machine system settings

For those who would rather configure the proxy natively on their operating system, we...

Anatomy of a JMeter test

With the samples we have explored so far, we have seen a similar pattern emerging. We have seen what mostly constitutes a JMeter test plan. We'll use the remainder of this chapter to explore the anatomy and composition of the JMeter tests.

Test plan

This is the root element of the JMeter scripts and houses the other components such as Threads, Config Elements, Timers, PreProcessors, PostProcessors, Assertions, and Listeners. It also offers a few configurations of its own.

First off, it allows you to define user variables (name-value pairs) that can be used later in your scripts. It also allows the configuration of how the thread groups that it contains should run, that is, should thread groups run one at a time? As test plans evolve over time, you'll often have several thread groups contained within a test plan. This option allows you determine how they run. By default, all thread groups are set to run concurrently. A useful option when getting started is...

Summary

We have covered quite a lot in this chapter. You learned how to configure JMeter and our browsers to help record test plans. In addition, you learned about some built-in components that can help us feed data into our test plan and/or extract data from server responses. In addition, you learned what composes a JMeter test plan and got a good grasp on those components.

In the next chapter, we will dive deeper into form submission and explore more JMeter components.

Left arrow icon Right arrow icon

Description

This book is great for developers, quality assurance engineers, testers, and test managers new to Apache JMeter, or those who are looking to get a good grounding in how to effectively use and become proficient with JMeter. No prior testing experience is required.

Who is this book for?

This book is great for developers, quality assurance engineers, testers, and test managers new to Apache JMeter, or those who are looking to get a good grounding in how to effectively use and become proficient with JMeter. No prior testing experience is required.

What you will learn

  • Set up and prepare Apache JMeter for testing
  • Record test scenarios or create them from scratch
  • Test RESTful web services
  • Effectively monitor resources during performance tests
  • Build realistic, comprehensive, and maintainable test plans
  • Understand distributed testing using Vagrant, AWS, Flood.io, and BlazeMeter
  • Extend JMeter functionality through plugins
  • Understand and effectively use JMeter components to achieve testing needs

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Apr 24, 2015
Length: 164 pages
Edition : 1st
Language : English
ISBN-13 : 9781784394813
Vendor :
Apache
Languages :
Tools :

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : Apr 24, 2015
Length: 164 pages
Edition : 1st
Language : English
ISBN-13 : 9781784394813
Vendor :
Apache
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
R$50 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
R$500 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just R$25 each
Feature tick icon Exclusive print discounts
R$800 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just R$25 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total R$ 791.97
JMeter Cookbook
R$272.99
Performance Testing with JMeter, 2nd Edition
R$245.99
SoapUI Cookbook
R$272.99
Total R$ 791.97 Stars icon
Banner background image

Table of Contents

8 Chapters
1. Performance Testing Fundamentals Chevron down icon Chevron up icon
2. Recording Your First Test Chevron down icon Chevron up icon
3. Submitting Forms Chevron down icon Chevron up icon
4. Managing Sessions Chevron down icon Chevron up icon
5. Resource Monitoring Chevron down icon Chevron up icon
6. Distributed Testing Chevron down icon Chevron up icon
7. Helpful Tips Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.7
(7 Ratings)
5 star 28.6%
4 star 42.9%
3 star 0%
2 star 28.6%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




Atul Jun 26, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
As I’m Senior QA Engineer i would recommend this book to everyone out there who are looking to get expertize in Performance testing using Apache Jmeter. I purchased Performance Testing with Jmeter - Second Edition; this contains most of topic which can be used to get expertise in jmeter tools. Almost everything is covered with real time examples which make this book different from other out in market.The book not only covers Jmeter topics but also other tools & plugins which can be used with Apache Jmeter.I would appreciate Bayo Erinle and team who came out with book as there are not much resource related to performance testing using jmeter.Last i would say surely go garb it.
Amazon Verified review Amazon
Jason Klueber Jun 26, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I am a software developer for a small IT shop with big plans in the future. As such, I've been researching ways to do automated performance and load testing on our web application. This book, which begins with a business case for JMeter, was an excellent find for me. It steps through areas where JMeter is useful, and provides clear examples for not only how to configure JMeter, but what you're accomplishing by doing so. From a readability perspective, the electronic copy is clear and I did not find any tables or illustrations which overran the page boundaries.For both initial research and early implementation, I can recommend this book as a guide to JMeter.
Amazon Verified review Amazon
Leonardo Mar 16, 2016
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
Excellent book for testers!
Amazon Verified review Amazon
Amazon Customer Jun 11, 2016
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
Good. .
Amazon Verified review Amazon
Alexander P Jul 10, 2015
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
It is good to see the second edition of this book out. There are some improvements and additions, but probably what I wrote about the first edition still makes sense:It is very surprising that actually no decent books about load testing tools were published for 20+ years of their history. So it is nice to see Performance Testing With JMeter by Bayo Erinle published by Packt Publishing.It is, of course, a rather basic book. I don't think that it would be very useful to experienced JMeter users. However, it may be very good for somebody who is doing their first steps in performance testing and need step-by-step tutorial to introduce them into the topic. Perhaps users of other load testing tools may benefit from the book if they want a quick introduction into JMeter (and don't want spent time figuring out what is what in documentation). The book does exactly what the title says: explains one way of how basic performance testing may be done with JMeter 2.9. It doesn't deviate much into available options (which exist in abundance), doesn't talk much about generic principles of performance testing or performance engineering. However, if complemented by more generic performance engineering books, it may be a good starting point for a journey into performance testing (especially considering that no other alternatives worth mentioning available except tool-related documentations and articles).The book is 130 pages long and topics covered may be seen from the chapter names:Chapter 1: Performance Testing FundamentalsChapter 2: Recording Your First TestChapter 3: Submitting FormsChapter 4: Managing SessionsChapter 5: Resource MonitoringChapter 6: Distributed TestingChapter 7: Helpful TipsThese 130 pages include step-by-step instruction (with screenshots) of installing and configuring JMeter, Tomcat (used for resource monitoring), and Vagrant/Puppet/AWS (used for distributed testing).Suggestions to create and run scripts against public sites such as Apache and Google sound rather questionable to me. Providing a sample web site built to accompany the book to run other exercises against looks like a much more interesting and valid approach (assuming that the web site stays up and running).Overall, I guess, the book fulfills its purpose to introduce using JMeter 2.9 for basic performance testing and may be a good starting point for a beginner. Although I am not sure that the author always chooses the simplest ways to introduce topics. And I definitely advise not to stop there if you want to become a good performance tester.P.S. Another book of the same author - JMeter Cookbook - may be a good complement to this book.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.