JMeter and Taurus Training (1/3)

Introduction to Load Testing & Performance Engineering

Melissa Huerta Dev
WomenWhoCode Silicon Valley
5 min readSep 15, 2020

--

Last month Rachna Bafna, Sr. Performance Engineer, led 10 training sessions in which she spoke about Load Testing & Performance Engineering using JMeter and Taurus tools, in this article we’ll cover the first three ones.

You’ve probably heard about ‘Performance Engineering’, but if not, in shortly, it covers the techniques applied during the development life cycle of system, seeking to perform requirements such as:

Measures of an application’s performance.

Throughput: number of requests/units that can be handled per unit of time.

Latency: response time taken from the request.

Resource utilization.

Implementing the use of Performance Engineering in our system will help us to make it scalable (size changing), reliable (functional under conditions) and allow it to meet the SLAs (service level agreement, in this case, service response).

Applying this discipline will save us more than once, we should consider cases as holidays and outages, predict the amount of load we are going to get and get ready to have the resources to handle that load. This will give us the input so we can provide a better system or software.

How to build a performance engineering culture? 💡

To build a Performance Engineering culture you should follow these steps:

Steps taken from JMeter & Taurus sessions.

First, you must understand the services your software provides and how they work.

Next, you should design the workload, based on which services are most used or the services that make the most of the traffic and then write load test scripts (you can use JMeter to simplify this task).

Once you have the load tests written, you need to the run, monitor an analyze then. Depends of the results you get, you need to understand what’s happening, the bottlenecks you may found and fix them, by doing this, you you will have optimized your software. Remember to repeat. 😉

Load Testing/Performance Testing Tools

Tools as JMeter, Blazemeter and NeoLoad are used to simulate heavy load on a server(s), network or object to test its strength, performance; your selection will vary according to your organization requirements.

In these sessions, Rachna Bafna will teach us how to use JMeter, an open source tool which she has over 6 years of experience training with, & Taurus, automation friendly framework to run JMeter tests. See the short demo.

In this article, we’ll cover Taurus installation, use of JMeter and BlazeMeter.

Let’s start!

👩🏽‍💻 Activity: Install Taurus and write your first script

☞ Go to Taurus and follow the 3 steps: installation, creating a ‘.yml’ file and running it from the terminal (MacOs) or command prompt (Windows).

Activity: Install Taurus and write your first script

👩🏽‍💻 Activity: Open JMeter and create a TestPlan

☞ Go to the JMeter folder .bzt/jmeter-taurus/5.2.1/ ‘5.2.1’ can vary according to the version.

☞ Execute sh jmeter it will open.

Open JMeter and create a TestPlan
  • JMeter is divided in 2 sections: project directory and an area where you can see what your components are.
  • TestPlan: a test plan describes a series of steps JMeter will execute when run. Every test plan should have a thread group.

👩🏽‍💻 Activity: Create a Thread Group, a Request and view the results

  • Thread Group: is a set of threads executed, simulates user interactions.

☞ To create a ‘Thread Group’ follow this:

Creating a Thread Group

In the thread group we’ll find information as:

  • Concurrency: numbers of users.
  • Ramp-up period: time to get all the threads up and running.
  • HTTP request: protocols + server name + request path.
Thread Group section.

☞ To create a ‘HTTP Request’ follow this:

Creating a HTTP Request

☞ In the ‘HTTP Request’ section, we must fill the following information:

HTTP Request section.

☞ To create a ‘View Results Tree’ follow this:

Creating the View Results Tree
  • View Results Tree: every request that is sent will be shown and their details in here.

☞ Run your test by clicking in the green play button ►

☞ Click on ‘View Results Tree’ and you will see the results of your request 😊

View Results Tree section

Awesome! 👏🏼 You finish the first part, now you know how to execute JMeter and to create the basic test structure.

⚠️ After doing this exercise, remember to disable “view results tree”, to avoid consuming resources.

👩🏽‍💻 Activity: Install BlazeMeter

  • BlazeMeter is a plugin compatible with Chrome, the installation will take less than a minute. This UI will create tests and scripts for us by just simply recording our actions (requests).

☞ Go to the Chrome link.

👩🏽‍💻 Activity: Record tests request

☞ Choose a website to test, for the purpose of this activity, we chose OrangeHR website, but you can test with your own website.

☞ Start recording your test with ‘BlazeMeter’, follow this short video.

Activity: Record tests request

Note: BlazeMeter will not count the “thinking time”, this refers to the time that the user spends thinking or filling information when she/he logs in.

👩🏽‍💻 Activity: Download and open your test record.

☞ Save your recorded test and download the file.

☞ Open this file using JMeter.

☞ Check the results.

Activity: Download and open your test record

In this section you will find different data, here are some of the definitions:

  • HTTP Header: in headers you are going to have either specific to your request headers or generic ones, in here, you can specify information as Content Type, Authorization.

You can also add headers manually following these steps:

Creation of HTTP Header Manager.
  • HTTP Cookie manger: in here you’ll find cookies that track the user’s sessions (every time a user hits a url), it holds the session id that is used to access to another url, remember that every user will have a different cookie.

Amazing! 👏🏼 If you get here, you finish the second part, now you know use BlazeMeter and you will save a lot of time while creating tests scripts.

This blog is a summary of a serie of event sessions run by the WomenWhoCode Silicon Valley on July 28, 2020. You can view the recording of the event below.

JMeter and Taurus Training Sessions by Rachna Bafna

🙋‍🙋🏽‍♀️ View and register for our upcoming events at http://bit.ly/siliconvalley_events

--

--