Build JMeter Test Plan
A Test plan will be the first which is present when you open JMeter, it considered as a root node that has potentially many levels of additional elements/nodes that forms a hierarchy, which JMeter executes when we run test plan. A Test Plan can be viewed as a container for running tests.
A test plan can consist of one or more elements like Thread Groups, Logic Controllers, Configuration Elements, Timers, Listeners and Assertions. A test plan must have at least one thread group.
Let's start building a Test plan by following these simple steps:
Step to Launch the JMeter window.
Or
Go to your JMeter bin folder( apache-jmeter-5.3/bin/ ) and run command "./jmeter.sh or ./jmeter"
- Rename your test plan
- User Defined Variables provides flexibility when you have to repeat any value in several parts of the test plan. You will be able to change the value from a single point, and it will reflect everywhere.
- Optional – or you can use according to your needs
- WorkBench is used to store test elements temporary for copy/paste. It is also used for Non-Test Elements like HTTP(S) Test Script Recorder, HTTP Mirror Server and Property Display. If you need to save it along with the test plan, then you should select the option “Save WorkBench” from WorkBench control panel.
- New test plan name is reflect on left side
- E.g. Variable name is set to “SITE”
- E.g. Variable value is set to URL (without http://): “google.com”
- Now, this variable can be used in any part of the test plan elements like this ${PATH}
Add and Remove Test Plan Elements
Steps to Add Elements to JMeter Test Plan
- Select the test plan node and right click on the selected item.
- Mouse hover on "Add" option, then elements list will be displayed.
- Mouse hover on desired list element, and select the desired option by clicking.
- The following image shows how to add a thread group element in a test plan:
- Select the desired element
- Right click on the element
- Choose the “Remove” option
- The following image shows how to remove a thread group element in a test plan:
Click "Yes" on the confirmation pop-up of remove element.
Load and Save JMeter Test Plan Elements
- Select and right click on any Tree Element, in which you want to add the loaded element
- Select “Merge” option
- Choose the .jmx file where you saved the elements
- Elements will be Merged into the tree
- Don’t forget to Save test plan / element
- Select and Right click on the element
- Choose “Save Selection As” option
- Save file on desired location
- JMeter will save the element, and all the child elements beneath it.
Steps to Configure Tree Elements
JMeter Actions on Test Plan
It’s always better to Save Test Plan before executing it. Test Plan can be saved by choosing “Save” or “Save Test Plan As” from File menu.
- Green button shows that test plan is running.
- Number of active threads / Total number of threads.
- Stop button is enabled when test plan is running.
- Stop (Control + ‘.’) It stops the threads immediately if possible. Many samplers are interruptible so active samples can be terminated early.
- Shutdown (Control + ‘,’) It requests the threads to stop at the end of any ongoing task. It will not interrupt any active samples.
JMeter stores test run details, warnings and errors to the jmeter.log file by default, you can access Jmeter logs for debugging purpose.
- It shows the total number of errors in log
- Click yellow triangle button to view log panel
- Logs are displaying in log panel
0 Comments