JMeter 101


JMETER 101
What is software testing? Software testing is the process of evaluating and verifying that a software product or application does what it is supposed to do. There are lots of benefits of having a test team or outsourcing testing of an app to testers The benefits of testing include preventing bugs, reducing development costs and improving performance. Testing can be done in two major ways; Manual and automation. But Generally, we have different types of testing that fall into the above-mentioned category, there are:
Acceptance testing: Verifying whether the whole system works as intended.
Integration testing: Ensuring that software components or functions operate together.
Unit testing: Validating that each software unit performs as expected. A unit is the smallest testable component of an application.
Functional testing: Checking functions by emulating business scenarios, based on functional requirements. Black-box testing is a common way to verify functions.
Performance testing: Testing how the software performs under different workloads. Load testing, for example, is used to evaluate performance under real-life load conditions.
Regression testing: Checking whether new features break or degrade functionality. Sanity testing can be used to verify menus, functions and commands at the surface level when there is no time for a full regression test.
Stress testing: Testing how much strain the system can take before it fails. Considered to be a type of non-functional testing.
Usability testing: Validating how well a customer can use a system or web application to complete a task.
The purpose of this Article is to explain the technicalities involved with Performance testing (Load Testing, volume, capacity, stress, reliability etc) While Using JMeter
Jmeter
The software is used to perform performance testing, functional testing, and load testing of web applications. It is used to test load testing functional behaviour and measuring performance. JMeter makes it possible by creating a huge number of concurrent users that simulate a heavy load. Initially, JMeter was developed to test applications but now has expanded to other test functions.
How to set up JMeter on macOS
- Download and Install Java* https://www.oracle.com/java/technologies/javase-downloads.html After installation, you can check whether Java JDK is installed successfully in your system.
- Download and Install JMeter http://jmeter.apache.org/download_jmeter.cgi
- Install the JMeter file as seen in the image below
- Jmeter window is launched successfully
Step-by-step guide on how to start working with Jmeter
After a successful installation of JMeter, one should understand the need to set up environments. For one to carry out even the basic test in JMeter these elements are important, there are; setting up thread group, samplers and listeners.
As a new Jmeter user I will start with creating my first test plan with pictures to explain my steps;
- Create the First Test Plan I mentioned setting up a thread group. Thread group here offers the tester the ability to configure the number of users needed to test the webpage. The tester can add up to 1000 users to the thread group. Steps to Adding a thread group:
- Open the JMeter window.
- The window is divided into two parts. The left side has all the added elements, while the right side has all - the elements' configurations.
- Rename the test plan and save it
- Now, rename it the Shecode Final Project.
- Right-click on the test plan.
- Go to add -> Threads (Users) -> Thread Group
Now, once you click on the Thread Group, there are three things on the screen that are important concerning the load test:
- The number of threads (users): This is the number of threads or users JMeter will simulate. Let's make it 250.
- Ramp-Up Period (in seconds): This is the time that JMeter takes before starting the thread over. Let’s keep this as 5.
- Loop Count: This is the number of times the test will be executed. And this one, let's leave it to be 1.
Add an HTTP Request The second component comes to play here “SAMPLERS” This option helps the tester input an HTTP request. There is a wide array of requests in this column. I will be using HTTP REQUEST
- Right-click on Shecode final project and again go to add
- In the drop-down select samplers
Here, in the Server Name or IP box, you have to give the server name or the IP. I will be using staging-backoffice.betamonie.com.ng
- Copy the URL
- Come back to the JMeter window and paste it into the Server Name box.
- Don't give HTTP or HTTPS since these protocols will come in the other box. They will be automatically taken in the HTTP request case.
- Then in the path dialog box, leave a forward slash there.
Now, when the HTTP test is ready, the next step is to perform the test on it. To complete the test: Add Listeners This brings us to the Third component “ Listeners”. This feature helps the tester to choose from the wide options how the tester wants the result to be displayed. To determine what the results of the test will be, you need to add some more test elements.
In the box that appears, there are different types of reports that JMeter provides. For now, I will select the three of these:
- View results in table
- View results tree
- Save responses to a file
Run the test Now, save the test and run it -For running the test, click the green button After running the test, check the results of the test
- Go to view the results in table
Benefits of JMeter
- Performance testing of applications: The application is used to perform performance testing on different - types of applications, like Web applications etc
- Supports: JMeter not only supports performance testing but other non-functional tests such as Stress Testing, Web Service Testing, and Distributed Testing.
- Recording and playback: The application provides record and playback options enabled with a drag-and-drop feature, making the application faster and easier. Charts and graphs for analysing test results
Conclusion
JMeter is a very valuable tool for determining how your web application server setup should be improved, to reduce bottlenecks and increase performance. I would recommend testers get to understand, explore JMeter and adopt this software as an important tool for load testing on web apps.
Subscribe to my newsletter
Read articles from Ndifreke Edem directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
