Performance Testing

Why you should test your application under specific circumstances

Nowadays, the internet is a global phenomenon. Most people use applications on smartphones for social media, email, games, trip advice, to buy tickets for events, city transport etc. Even elderly people use the Internet too. But when user numbers go up, the performance of applications goes down. And sometimes app owners and business analyzers fail to predict the correct number of users before releasing the product. This can create problems. For example, when an app is designed to work for 100 users at the same time but more users want to use it.

Black Friday curse

There are actually a lot of examples of this: Black Friday – the website with electronic staff – works well on a daily basis because it was designed for this purpose. However, when there’s a national holiday such as Black Friday (great discounts) the website switches off – too many users wanting to buy stuffand the server simply can’t support it.

A few years ago we saw a similar thing  with on-line voting in Poland, when the website went down. This is why we can now only vote physically, no longer on-line.

A few words about performance testing

Performance tests are carried out to assess the degree of fulfillment of the performance requirements by a system or module. Performance testing is a kind of non-functional testing.

There are 8 kinds of tests:

  1. Volume testing
  2. Load testing
  3. Stress testing
  4. Usability testing
  5. Maintainability testing
  6. Reliability testing
  7. Transferability testing
  8. Spike testing

How performance testing works in practice

When a user wants to do something in an application e.g. to change a page on a website, the request is sent from the user’s computer, the server loads this request and sends a  response to the client. Performance testing can check how the system will behave at a given load. If there are more users, our system has more requests and needs more time for the response, so performance goes down and users have to wait longer. If the server is overloaded, it turns off or changes the status to safe mode and the website stops working. Users can no longer access it,  which could well mean losses of money and clients. 

What performance looks like in statistics (data from 2015):
Amazon: a 100 millisecond better performance – 1% more profit (around 1 million dollars more per year)
Yahoo: a 400 millisecond better performance – 9% more profit (around 15 million dollars more per year)
Mozilla: reduction of page loading time by 2.2 seconds (60 million more browser downloads )

Example apps:

  • Jmeter
  • Gatling
  • Grinder
  • LoadRunner
  • LoadUI
  • Loadster

JMeter app:

JMeter is an open source application for creating performance testing. This is the most famous application from the above list. It has a nice UI and is very intuitive. It’s used successfully to simulate increases in traffic and also has the ability to generate test results, e.g. in graphic form or as a report. Creating tests with this tool is a pure pleasure.

Advantages of the JMeter tool:

  • Economical – it allows testing automation
  • Transferable – works on platforms supporting Java
  • Versatile – supports various protocols
  • Easy to learn – has extensive documentation
  • Current – is supported and developed
  • Low cost  – it’s free

Rights reserved

With JMeter we can test every application on the Internet, but remember – it’s illegal to test someone’s app on production without permission. So in my tests I will use the Scalac official website – I’ve created a copy of this website for a different environment and I can restore the server

How to install JMeter

Jmeter works on Java, so first we have to install Java version 12+. At the moment  Java 13.0.1 is the latest and you can download it from this link:
After installation you can confirm it in the console. Type: java –version
The screen is shown below:

performance testing

Next, download the JMeter app from this link:
Unzip the rar. file, and open the “bin” folder, then JMeter.exe (for Windows) or JMeter.exec (for Mac)

Let’s do some performance testing

Remember: I’m only giving you an example, you should use your own website

The data we will be using in our tests:

  1. 30 users, 60 seconds, 1 iteration
  2. 150 users, 120 seconds, 1 iteration

First up, we should add a “thread group” to our test plan.  Right click on the test plan, then choose “add” -> “thread users” -> “thread group”

performance testing tools

Fill the fields in the thread:
Name: “Scalac”
Number of threads (users): “30”
Ramp-up period (seconds): “60”
Loop count: “1”

It should look like this:
performance testingNext, we have to add “http request defaults” with the get method in the “Scalac” thread. This request will always open the main page, so in the next steps we don’t have to add the main page,just the next path from the website. Right click on the test plan, then choose “add” -> “config element” -> “http request defaults”

performance testing tools
Then fill in the fields:
Name “opening website”

Protocol “https”
Server name or IP “”

This is how it should look in the application

performance testing

Next add a new http request. Right click on the test plan, then choose “add” -> “sampler” -> “http request”

performance testing tools

Now we will add a “what we do” tab from the website to the next request. Field ”Server name or ip” we can leave this empty because we have it in “http request defaults”
Fill in these fields:
Name: “What we do tab”

Method: “Get”

Path: “/what-we-do/”

Like on this screen:

performance testingYou can do the same action with other tabs “about us”, “Careers”, “Blog” Please don’t add the “contact” tab because we will be using it later with the post method. Next, add a summary report to show the results of the test. Right click on the test plan, then choose “add” -> “listener” ->”summary report”

performance testing tools
Now we can start the test. Just click the “start” button:

performance testing tools

When the test is finished, we can check the summary report: The aAverage time of response to all requests from the server is 559 milliseconds, the minimum is 230ms, max is 2197, and there are 0% errors :) We also have statistics from individual tabs
tools for performance testingThe first tests are behind us :) Now we will use the post method to send data to the server (e.g. login, register to the app etc.).

Our test case will look like this:
1) Go to the “contact” page
2) Fill in two fields “email”, “message”
3) Send using the post method data from the fields

Firstly, we have to check what the developers have called these fields in the structure of the website. To check this, we have to use the console from the browser and send some data.
In the “email” field type “this is email”
In the “message” field type “this is message”

Click the “estimate my project” button on the website with the opened console and go to the “network” tab, then go to the “headers” tab in the network section and scroll down. You can see what the developers have called these two fields:
1) “your-email”
2) “your-message”

performance testing

Go back to the JMeter app and create a new http request. Type:
Name: “Contact tab – post data”
Method: “post”
Path: “/contact/”

Now you have to add the data to send the post request:

1) Email:
In the section “Send parameters with the request” click “add”
In the table “name”, type the name from the website structure which you found earlier in the console:
In the table “value”, type the email you want to send. I have entered “

2) Message:
In the section “Send parameters with the request”, click “add”
In the table “name”, type the name from the website structure which you found earlier in the console:
In the table “value”, type the message you want to send. I have entered “performance testing”

Look at the screen:

tools for performance testing
Now you can add “View results tree” to check individual requests and track errors. Right click on the test plan, then choose “add” -> “listener” ->”View results tree”. Now we can start the test. Finally, the report looks like this:

performance testing
Let’s check it in “view results tree”. We had no errors, but we can look at the details for all the requests:

tools for performance testingAs you know, automatically testing without assertion is pointless. In Jmeter we can add a lot of different kinds of assertions. I will show you response code and duration

  1. Response code 200:

Right click on the test plan, and choose “add” -> “assertions” -> “response assertion”:

performance testing
Steps to add the assertion code:

  1. In the “field to test” field, check “response code”
  2. In the “pattern matching rules” field, check “contains”
  3. In the “patterns to test” click “add” and type “200”

Software testing

Now you can start the test, and you can check there are no errors, because the website is working correctly, so it returns a status 200 code. If not, there will be assertion errors

2. Duration assertion

You can set how many milliseconds will be accepted in the test. For example, if you set a 1000ms duration assertion and the test will be longer, the assertion will fail. Let’s add this assertion to our test plan. Right click on the test plan, and choose “add” -> “assertions” -> “duration assertion”:

Software testing
“Duration in milliseconds” set to “1000”
Software testing
Now you can start the test, and open the “view results tree” from the test plan. As you can see, all the tests which have a time of more than 1000 milliseconds are failed, because the added assertion works correctly

tools for performance testing

How to Generate a graphical report in JMeter

Graphic reports are more transparent than other reports, because we can see the statistics in a diagram or chart, and we can compare all the tests. It’s not easy in JMeter, but to generate a graphic report from jmeter we have to change the code in the file. You need to copy this file from the “bin” folder from jmeter, to the folder you want (for example: documents/scalac)

Open this file, go to the “reporting configuration” tab, delete some “#” to uncomment the code and change the time to 600000 milliseconds (the red arrow on the screen). It should look like this:

performance testing jmeter
The yellow arrow is a code copied from JMeter. Please open the “tools” tab in JMeter, and click on the “export transactions result” option. Like this:

testing jmeterAnd copy the code from “export transactions result”

performance testing

Then you can paste it to the file (the yellow arrow on the screen)

performance testing jmeter

Now save the file, and go to the console (terminal) and type this code:

./jmeter -n -t [address to your test plan file] -l [address where jmeter will create the csv file] -q [address to file] -e -o [folder where you want to create the report]

For example, my code in the console looks like this:

./jmeter -n -t /Users/bartoszkuczera/Documents/scalac/scalac.jmx -l /Users/bartoszkuczera/Documents/scala/scalac.csv -q /Users/bartoszkuczera/Documents/scalac/ -e -o /Users/bartoszkuczera/Documents/scalac/report

Open the report folder, then the index.html file. You can see a lot of options in the graphic report

performance index
Go to the “charts” then to the “over time”. I think this graphic report is the best, because you have all the tests shown at the same time


Now you know why performance testing is so important- bad performance increases the product and design risk. yYou also now know how to do performance testing in the JMeter app and how to generate reports from the tests. To finish, here’s a funny meme on the subject of performance :)

Black Friday performance testing

Check out also:


Bartosz Kuczera

I have started my journey as a QA at Scalac, and I've been here for over 5 years now. I had the opportunity to work on different projects. I tested mobile, web, and desktop applications. I graduated from university with a degree in testing and an ISTQB certificate. Also, I already have an automatic testing certificate, but I'm still working hard on developing my skills in this area. Privately, outside the IT world, I am a dedicated event organizer, decoration maker, DJ, guitarist, music collector, and graffiti fan.

Latest Blogposts

13.11.2020 / By Anna Berkolec

How to achieve your goals by creating good habits instead of setting milestones

Did you know that about 40% of what we do every day we do automatically? Almost half of our life is taken up by habits that we've formed over our lifetime. People are simple creatures, and if something works, why not stick with it?

28.10.2020 / By Maciej Greń

Tubi x Scala: Why it works?

If you want to succeed in a World of ever-changing technology, you always need to be a step ahead of your competitors. Constantly pushing the boundaries is crucial if your business is to provide a flawless customer experience, and grow. Today, we’re going to show you the perfect example of a company that wasn’t scared of scaling up machine experimentation with Scala. And let us just take a sneak peek at that in one sentence: “I love working with Scala” | Alexandros Bantis, backend Scala Developer at Tubi The outcome is rather impressive, so read on to find out more about it!

01.10.2020 / By Daria Karasek

Do Scala with Scalac – 7 success stories to follow

From challenges to achieving goals - building a complex solution takes time and effort in order to seize all opportunities and deliver a high-quality product. Thinking about all the aspects you have to handle when developing software or making changes to existing ones can be a little overwhelming. Especially when a solution that used to work doesn’t fit your needs anymore and bottlenecks give you sleepless nights. Picking the right partner to help you manage this is a hard nut to crack. Maybe it’s high time to ask other companies about their own experience and recommendations?

Need a successful project?

Estimate project