Managing JMeter Test Plans
Creating a Test Plan
A test plan is used to initiate a performance test based on the defined JMeter files, JAR packages, and variable files.
- Log in to the CodeArts PerfTest console. In the navigation pane on the left, choose JMeter Projects. Then click in the row containing the desired project.
- On the Test Plans tab, click Create Task Plan.
- In the dialog box that is displayed, click Select File, select a .jmx file, and click Upload. When the file is imported, the dialog box closes automatically and the Test Plans tab is displayed. You can view the added test plan.
- The name (including the extension) of a JMX file can contain up to 64 bytes. The file size can be up to 10 MB.
- Basic JMeter scripts are supported, including thread group, HTTP request, HTTP Header Manager, request parameters, BeanShell, and timeout interval. You are advised to use a script of version 5.2.1 or later. Otherwise, a script parsing error may occur.
- On the Test Plans tab page, click Third Party Jar. In the displayed dialog box, click Select File, select and import the JAR package on which the test plan depends. After the package is imported, close the dialog box.
- Java 9 and later versions do not support the upload of third-party JAR packages.
- The name (including the extension) of a JAR package can contain up to 64 bytes. The package size can be up to 80 MB.
- View the newly added test plan on the Test Plans tab.
Pressure Configuration
After creating a test plan, you can edit phase parameters.
- Log in to the CodeArts PerfTest console and choose JMeter Projects in the left navigation pane. Click in the row containing the test project to which the desired test plan belongs.
- On the Test Plans tab page, click the name of the desired test plan. On the Plan Detail page, you can view the stages of different thread groups. Set the basic information by referring to Table 1.
Table 1 Pressure configuration Parameter
Description
Execution Policy
The value can be Duration or Count.- Duration: Tests will be performed based on the specified duration.
- Count: Tests will be performed based on the total number of tests.
Number of Threads
Number of concurrent virtual users.
Ramp-up Period
It corresponds to the ramp-up period in JMeter scripts. The parameter indicates the time required for increasing the number of concurrent users from 0 to the specified value.
NOTE:This parameter is involved only in Phase1.
Loop Count
Number of execution times of each virtual user.
NOTE:This parameter needs to be configured only when Execution Policy is set to Count.
Specify Thread Lifetime
If you enable this option, you can configure the Duration and Startup Delay parameters.
NOTE:This parameter needs to be configured only when Execution Policy is set to Count.
Duration
If the actual test duration reaches the maximum duration and the number of execution times does not reach the number of cycles, the thread group execution ends.
NOTE:This parameter can be configured only when Execution Policy is set to Count and Specify Thread Lifetime is enabled.
Duration
How long the test will run. It is recommended that the duration be set to at least 300 seconds.
NOTE:This parameter needs to be configured only when Execution Policy is set to Duration.
Startup Delay
When a test task is started, CodeArts PerfTest will wait the duration of startup delay before generating virtual users.
NOTE:This parameter can be configured when Execution Policy is set to Count and Specify Thread Lifetime is enabled.
When Execution Policy is set to Duration, you can modify this parameter for Phase1.
- Click OK.
Debugging a Test Plan
When a test plan is added or modified, you can debug it to quickly detect syntax or configuration errors and ensure that the model is available in a performance test.
- Log in to the CodeArts PerfTest console and choose JMeter Projects in the left navigation pane. Click in the row containing the test project to which the desired test plan belongs.
- On the Test Plans tab page, click the name of the task to be debugged. On the plan details page that is displayed, click in the upper part of the page.
- On the debugging page, select a created private resource group as the executor and click Start to start debugging. You can view the debugging progress on the debugging page.
- After the debugging is complete, if an error is reported, modify the case based on the exception information and debug the case again. For details on how to import a .jmx file, see the section on modifying a test plan in Managing Test Plans.
- Click View log to view the test plan debugging details.
- On the Debug log tab page, you can view the debugging history.
Associating an Analysis Object (Optional)
Prerequisites
The test plan is not enabled.
Procedure
- Log in to the CodeArts PerfTest console. In the navigation pane on the left, choose JMeter Projects. Then click in the row containing the desired project.
- On the Test Plans tab page, select the test task to be associated with the analysis object, and click .
- Select the analysis object to be associated. If you need to associate another analysis object, click Add Object to add one by referring to Configuring Intelligent Analysis for JMeter Projects. Then select the added analysis object to associate it, and click OK.
Starting a Test Plan
Test plans are a series of tests performed at different pressure points to continuously initiate pressure tests on a system. Testing allows you to obtain and analyze the performance data of the system.
You can add multiple test plans to a test project.
Prerequisites
- The resource group is in the Running state.
- Ports 32001 and 32003 on the debugging node of the resource group are enabled in the security group.
- The execution node of the resource group and applications under the pressure test are connected through the network.
Procedure
- Log in to the CodeArts PerfTest console. In the navigation pane on the left, choose JMeter Projects. Then click in the row containing the desired project.
- Create a test plan. For details, see Creating a Test Plan.
- Click in the row containing the created task.
- In the Start Test Task dialog box, select a resource group. Only private resource groups are supported for executing JMeter tasks.
- Click Start to start the test task. Click View Report to view the real-time performance report.
It is recommended that the duration of a pressure test be at least 300s and the number of concurrent users be set based on the actual situation. Obtain the maximum pressure value for the application through repeated tests by adjusting test data, and perform continuous optimization and verification for the application.
Managing Test Plans
You can manage created test plans.
Enabling test plans in batches
Enable multiple test plans in a test project.
- Log in to the CodeArts PerfTest console. In the navigation pane on the left, choose JMeter Projects. Then click in the row containing the desired project.
- On the Test Plans tab page, select multiple test plans and click Start.
- Select resource groups of these tasks and click Enable.
Advanced configuration of test plans
- Log in to the CodeArts PerfTest console. In the navigation pane on the left, choose JMeter Projects. Then click in the row containing the desired project.
- On the Test Plans tab page, click in the row containing the desired plan.
- Configure advanced parameters.
- Executor: The number of executors takes effect only when private resource groups are used. If this parameter is not set, the default policy is used, that is, a single executor supports concurrent JMeter (1000). Number of executors ≥ Maximum number of concurrent users in all phases/1,000.
- Failure Log Collection Ratio: By default, the sampling ratio is 10‰, and can be set to 1000‰ at most.
- When the configuration is complete, click OK.
Editing a test plan
- Log in to the CodeArts PerfTest console. In the navigation pane on the left, choose JMeter Projects. Then click in the row containing the desired project.
- On the Test Plans tab page, click in the Operation column of the desired plan, and choose Update jmx.
- In the displayed Edit Test Plan dialog box, import a new .jmx file, and then click Close.
- On the Test Plans tab page, click in the Operation column of the desired plan, and choose Variable File to import the files to be referenced by the test plan.
- Only .csv (UTF-8 without BOM) and .xlsx files can be imported.
- The maximum length of a file name (including the extension) is 50 bytes.
- The maximum size of an .xlsx file is 20 MB and that of a .csv file is 80 MB.
Deleting a test plan
Deleted test plans cannot be recovered. Exercise caution when deleting a test plan.
- Log in to the CodeArts PerfTest console. In the navigation pane on the left, choose JMeter Projects. Then click in the row containing the desired project.
- On the Test Plans tab page, click in the Operation column of the desired plan, and choose Delete. You can also select multiple test plans and click Delete to delete them all.
Figure 1 Deleting one or more test plans
- Delete the test plans as prompted.
Deleting phases
- Log in to the CodeArts PerfTest console. In the navigation pane on the left, choose JMeter Projects. Then click in the row containing the desired project.
- On the Test Plans tab page, click the task name to go to the Plan Detail page.
- Select the desired thread group, click next to the phase to be deleted, and click OK.
Phase1 cannot be deleted.
Exporting JMX Files, Variable Files, and JAR Packages
Prerequisites: The JMX files, variable files, and JAR packages have been imported.
- Log in to the CodeArts PerfTest console. In the navigation pane on the left, choose JMeter Projects. Then click in the row containing the desired project.
- On the Test Plans tab page, click in the Operation column of the desired plan, and choose Export to export its .jmx file.
- Click in the row containing the test plan whose variable file is to be exported and choose Variable File. The Variable File dialog box is displayed.
- Click Export in the row containing the variable file to be exported.
- Click Third Party Jar. The Third Party JAR Package dialog box is displayed.
- Click Export in the row containing the desired JAR package to export it.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot