Master Apache JMeter - From Load Testing to DevOps
eBook - ePub

Master Apache JMeter - From Load Testing to DevOps

Master performance testing with JMeter

Antonio Gomes Rodrigues, Bruno Demion (Milamber), Philippe Mouawad

Share book
  1. 466 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Master Apache JMeter - From Load Testing to DevOps

Master performance testing with JMeter

Antonio Gomes Rodrigues, Bruno Demion (Milamber), Philippe Mouawad

Book details
Book preview
Table of contents
Citations

About This Book

Learn how to get the most out of JMeter, improve the productivity of your apps, and integrate JMeter with your Agile and DevOps processes.Key Featuresā€¢ Gain insights into preparing test environments and selecting the correct use cases to load testā€¢ Learn to analyze a load test with Backend Listener, HTML Report Dashboard, and View Results Treeā€¢ Explore how to integrate JMeter in the software factoryBook DescriptionLoad tests help identify the maximum number of requests a software system can handle. One popular open source tool for load testing is JMeter. By leveraging the features and capabilities of JMeter, you can perform extensive load testing and fix issues in your application before they become problematic.This book is written by JMeter developers and begins by discussing the whole process, including recording a script, setting it up, and launching it, enabling you to almost immediately start load testing. You'll learn the best practices that you must follow while designing test cases. You'll also explore the different protocols offered by JMeter through various real-world examples. Finally, you'll see how to integrate JMeter into the DevOps approach and create professional reports. You'll discover ways to use the eco-system of JMeter to integrate new protocols, enrich its monitoring, and leverage its power through the use of the cloud.By the end of this book, you'll know all that's needed to perform comprehensive load testing on your applications by using all the best practices and features of JMeter.What you will learnā€¢ Explore various JMeter concepts, including Timers scope and Assertions scopeā€¢ Discover the types of test protocols and load tests that JMeter supportsā€¢ Design a realistic test scenario using various tips and best practicesā€¢ Prepare your test environment with injectors and the system under testā€¢ Learn and apply good practices when recording a scriptā€¢ Integrate JMeter with Jenkins using MavenWho this book is forThis book contains all the valuable information you need in one place and is a must for everybody who is seriously working with JMeter. It might be a little condensed for absolute beginners, but this book is the best you can find if you already have some performance testing experience and want to get further. In particular, it would be invaluable to developers who want to expand their JMeter knowledge into advanced topics or switch to JMeter from other load testing tools.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on ā€œCancel Subscriptionā€ - itā€™s as simple as that. After you cancel, your membership will stay active for the remainder of the time youā€™ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlegoā€™s features. The only differences are the price and subscription period: With the annual plan youā€™ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, weā€™ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Master Apache JMeter - From Load Testing to DevOps an online PDF/ePUB?
Yes, you can access Master Apache JMeter - From Load Testing to DevOps by Antonio Gomes Rodrigues, Bruno Demion (Milamber), Philippe Mouawad in PDF and/or ePUB format, as well as other popular books in Computer Science & Web Programming. We have over one million books available in our catalogue for you to explore.

Information

Year
2019
ISBN
9781839218200
Edition
1

Chapter 1

Quick Start with JMeter

With JMeter, you can quickly run your first load test. This chapter will show you how to set up a simple test case with JMeter and its HTTP(S) Test Script Recorder element.

Our Process

Here are the steps to set up our test:
  1. Launch JMeter and prepare the recording of our script
  2. Configure the browser to use the HTTP(S) Test Script Recorder of JMeter
  3. Record the script
  4. Customize our script (add assertions, rename transactions, add think timeā€¦)
  5. Validate our script with a single user
  6. Configure the load test (define the number of users, number of iterations, warm-up duration, and load test durationā€¦)
  7. Run and analyze the load test

Setup JMeter to Record Our Browsing Session

  1. Launch JMeter:
    Figure 1.1: JMeter
    Figure 1.1: JMeter
  2. Use the Templatesā€¦ feature of JMeter:
    Figure 1.2: JMeter Templatesā€¦ feature
    Figure 1.2: JMeter Templatesā€¦ feature
  3. Choose Recording with Think Time model and click Create:
    Figure 1.3: Recording template
    Figure 1.3: Recording template
  4. The test plan is ready:
    Figure 1.4: Result of Recording template
    Figure 1.4: Result of Recording template
  5. To save time in the future, we will select the HTTP Request Defaults element and fill in the Server Name or IP and Port Number sections:
    Figure 1.5: Result of Recording template
    Figure 1.5: Result of Recording template

    Note

    With this trick, we will share these two fields in every element HTTP Request Defaults and JMeter will not put them in each HTTP Request during recording.

    Caution

    During the load test, you should avoid having the injector (JMeter) on the same server as the application under test.
    Otherwise, the injected load will be impacted by the application's bad performance, and the application could be impacted by the injector's bad performance.
    Our tree is ready; we must now start the proxy server of JMeter.
    But before doing that, let's look at the HTTP(S) Test Script Recorder element.
  6. For the name of recorded transactions, we have two options in Recorder:
    Transaction name, which allows you to fully name them as you wish.
    Prefix, which will just prepend the prefix to the default name given by JMeter, which is usually the URL path.
    Figure 1.6: Transaction naming strategy
    Figure 1.6: Transaction naming strategy
  7. Note that with the default configuration of the template, static resources (image, CSS file, JS fileā€¦) are not recorded:
Figure 1.7: Exclude static resource capture
Figure 1.7: Exclude static resource capture
JMeter is now ready to record our navigation session.

Configure Your Browser

  1. In order for JMeter to record the navigation session, we must configure our browser to use the proxy server that JMeter launched.
  2. For example, with Firefox, choose the menu Edit > Preferences:
    Figure 1.8: Proxy selection in Firefox
    Figure 1.8: Proxy selection in Firefox
  3. Then select the Advanced tab and then the Network sub-tab. Let's click on Settingsā€¦:
    Figure 1.9: Proxy selection in Firefox ā€“ Network
    Figure 1.9: Proxy selection in Firefox ā€“ Network
  4. In the new window, select the Manual proxy configuration option, then fill in the HTTP Proxy field with the following IP address: 127.0.0.1 (corresponding to the local IP address (localhost)), and fill in the Port field with 8888 (corresponding to the default listening port of the JMeter proxy server).

    Caution

    When recording a local application, be careful to delete localhost and 127.0.0.1 from the No Proxy for: field.
  5. Finally, check the Use this proxy server for all protocols box.
  6. Let's save the modifications by clicking on the OK button in the Firefox window:
Figure 1.10: Proxy selection in Firefox ā€“ configuration
Figure 1.10: Proxy selection in Firefox ā€“ configuration

Save Our Script

Now, let's start our navigation session.
  1. To do this, simply click the Start button on the HT...

Table of contents