How to Create Test Plan Using Jmeter?

What Is Jmeter?

Apache JMeter is an open source and 100% pure java testing tool used for performance testing, load testing, and functional testing of web applications.

What Is Test Plan?

  • The Test plan identifies the items, the features to be tested, the types of testing to be performed, the personnel responsible for testing, the resources and schedule required to complete testing, and the risks associated with the plan.

Create a Jmeter Test Plan

  • A Test Plan can be considered as a root node that has potentially many levels of additional elements/nodes that form a hierarchy, which JMeter executes when we run the test plan. A Test plan can consist of more than one element such as thread groups, logic controllers, timers, listeners, etc but It must important to have a minimum of one thread group in every test plan.
  • Go to the JMeter bin folder like D:\apache-JMeter-5.4.3\bin.
  • Double click on Apache JMeter Executable Jar File
  • After some time you can see the following Jmeter Screen
  1. Rename your Test Plan.
  2. User-defined variables give flexibility when you have to repeat values in several parts of the test plan.
  3. You can use it according to your needs.

Add Thread Group

After creating a test plan for JMeter, the next thing we should be learning is to Add Thread Group to JMeter Test Plan.

Steps to add Thread Group to JMeter test plan

1 — Select Test plan node

2 — Right click on the selected plan

3 — Mouse hover on the “Add” option, then elements will be displayed.

4 — Mouse hover on Threads (user)

5 — Select Thread Group

After creating the Thread Group element, you can see the following screen

Note: At this screen, elements can also be loaded from a file and added by selecting the “merge” or “open” options.

Need to follow the below steps to remove elements from the Jmeter test plan

When you add elements to a Test Plan, you may like to remove them by following steps :

  1. Select the desired element
  2. Right-click on the element
  3. Select the “Remove” option

Click on “Yes” to remove the confirmation popup

Load and Save the JMeter Test Plan

Above we learned to add and remove elements, now let’s discuss the Load and Save JMeter Test Plan.

Steps to Load Elements to Jmeter Test Plan

  1. Select and right-click on the Thread group in which you want to add the loaded element
  2. Click on the “Merge” option
  3. Select the .jmx file where you saved the elements
  4. Elements will be merged into that thread group
  5. Save the Test Plan /Element

Points to Load elements to JMeter Test Plan

  1. Select and Right click on the Thread element
  2. Select the “Save Selection As” option
  3. Save the file at the specified location

Steps to Configure Thread Group Elements:

We can configure it by using the control panel on JMeter’s right-hand side frame. The controls allow us to configure the behavior of selected elements like the number of threads, Ramp-up period and scheduler, etc. as shown below.

Till now we have done with Creating test plans, Adding elements, and configuring elements.

Let’s just move forward with different operations on the Test Plan like Save, Run & Stop

Recommended to Read:- Introduction of Apache JMeter Performance Testing Software

Steps to Save JMeter Test Plan:

Before Executing the test plan it’s better to save it. Test Plan can be saved by selecting “Save” or “Save Test Plan As” from the File Menu.

A test plan is run by clicking on the Green Play button.

  1. The green button shows that the Test Plan is executing
  2. Total number of active threads
  3. The stop button enables when the Test plan is running

Steps to Stop JMeter Test Plan:

  1. Stop: This stood the thread immediately if possible. Many samplers are interruptible so active samplers can terminate early.
  2. Shutdown: This requests the threads to stop at the end of any ongoing task. It will not interrupt any active threads.

Steps to Check JMeter Test Plan Execution Logs

JMeter stores all Test run details, warnings, and errors to the JMeter .log file by default, You can use JMeter logs for debugging purposes.

  1. Jmeter shows the total number of errors in the log
  2. Click the yellow triangle button to view the log panel
  3. Logs display in the log panel

If you are interested in even more software testing-related articles and information from us here at Devstringx, then we have a lot to choose from.

Originally published at https://www.devstringx.com on September 14, 2022

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Devstringx Technologies

Devstringx Technologies

41 Followers

Devstringx Technologies is highly recommended IT company for custom software development, mobile app development and automation testing services