Esta página ainda não está disponível no idioma selecionado. Estamos trabalhando para adicionar mais opções de idiomas. Agradecemos sua compreensão.
- What's New
- Function Overview
- Service Overview
- Billing
- Getting Started
-
User Guide
- CodeArts PerfTest Use Process
- Permissions Management
- Test Resource Management
- PerfTest Project Management
-
PerfTest Case Management
- Test Case Description
- Directory Management of Test Cases
- Creating a Test Case
-
Configuring a Test Case (High-Performance Test Projects)
- Filling in Case Details
- Configuring a Case Script
- Adding Request Information (Packet)
- Adding Request Information (Think Time)
- Adding Request Information (Response Extraction)
- Adding Request Information (Checkpoint)
- Adding a Data Instruction, Cycle Controller, Condition Judgment, or Rendezvous Point
- Adding Concurrency Weight Controllers and Throughput Controllers
- Pressure Configuration
- Advanced Configuration
- SLA Configuration
- Configuring a Test Case (Scalable Test Projects)
- Setting Global Variables (High-Performance Test Projects)
- Setting Global Variables (Scalable Test Projects)
- Binding a Domain Name
- Plug-in Management
- Resetting Configurations
- Managing Test Cases
- Debugging a Case
- Batch Operations
- PerfTest Task Management
- PerfTest Report Management
- Transaction Management
- JMeter Test Project Management
- Crontask
- Configuring SLAs
- Auditing
- Reference
- Best Practices
- API Reference
- SDK Reference
-
FAQs
- Resource Group Management
-
Pressure Test Project Management
- What Are the Differences Between Think Time and Duration in CodeArts PerfTest?
- What Is the Number of Concurrent Users?
- How Do I Fill in Packets?
- Why Does Transaction Debugging Frequently Fail?
- Which Headers Are Mandatory in an HTTP-based Packet Request?
- Why Is the CPU Usage of the Execution Node Used for the Pressure Test Constantly High?
- What Are the Differences Between Global Variables and Variables Extracted from Responses?
- What Is the Impact of the Bandwidth Applied for CodeArts PerfTest on Tests?
- What Are the Differences Between a JMeter Test Project and a PerfTest Project?
- How Do I Check If the Global Variable Values Are Read Sequentially in a Test Task?
- Pressure Test Report Management
-
General FAQs
- What Are the Permissions Required for Using CodeArts PerfTest?
- How Do I Use the New IAM Edition to Isolate Permissions by Enterprise Project?
- Does CodeArts PerfTest Support Windows Server 2016 Standard (64-bit)?
- What Can I Do If Chinese or Special Characters Are Not Properly Displayed When the API Response Body Containing Them Is Exported Using the Traffic Recording Plug-in?
-
Using JMeter Projects
- What Are the Differences Between the JMeter Engine of CodeArts PerfTest and the Open-source JMeter?
- What Scripts Does the JMeter Engine of CodeArts PerfTest Support?
- Which Operations in Scripts Are Not Supported by the JMeter Engine of CodeArts PerfTest?
- What Are the Possible Causes of a JMX File Import Error in a JMeter Test Project?
- What Are the Suggestions for Using CodeArts PerfTest Scripts?
- How Do I Use the Global Variable Function?
- What Should I Pay Attention to When Uploading a Third-Party JAR Package?
- What Should I Pay Attention to When Uploading a CSV File?
- What Should I Pay Attention to When Uploading a Custom Installation Package?
- Why Does CodeArts PerfTest Return Garbled Characters When Content-Type in the Request Header Is Set to UTF-8 in JMeter?
- What Are the Meanings of Log Errors in a JMeter Report?
- Why Does JMeter Case Debugging Fail in Less Than 5 Seconds and No Data Is Displayed on the Page?
- Videos
- General Reference
Show all
Copied.
Compiling JMeter Scripts on Your Local PC
- Start the JMeter client.
- Create a thread group.
Right-click Test Plan in the upper left corner of the JMeter client and choose Add > Threads (Users) > Thread Group from the shortcut menu to create a thread group for the JMeter test plan. A thread group is the basic execution unit of a JMeter project.Figure 1 Creating a thread group
- Add a request.
Right-click Thread Group, choose Add > Sampler > HTTP Request, and add an HTTP request to the thread group.Figure 2 Adding an HTTP request
- Configure the HTTP request.
The configuration on the Basic tab page of the HTTP request is as follows:
- Protocol: The value can be HTTP or HTTPS.
- Server Name or IP: Enter a domain name or an IP address.
- Port Number: Enter the service port number. For HTTP, the default port number is 80. For HTTPS, the default port number is 443. You can also manually enter other ports.
- HTTP Request: Specify the method, such as GET, POST, PUT, and DELETE. If you select POST, add body parameters.
- Path: Enter the service request path.
Figure 3 Configurations on the Basic tabOn the Advanced tab page of the HTTP request, set the timeout period in Timeouts.
- Connect: timeout period for connecting the client to the tested service. The default value is 20 seconds. You can set it to 10 seconds.
- Response: response time of the tested service after the connection. By default, there is no limit.
Figure 4 Configurations on the Advanced tab - Configure HTTP headers.
JMeter manages HTTP headers by thread group. Each thread group can be configured with an HTTP header manager. Right-click Thread Group and choose Add > Config Element > HTTP Header Manager to add an HTTP header manager. In the right pane of the HTTP Header Manager, click Add to add an HTTP Header.Figure 5 Adding an HTTP header
- Configure View Results Tree.
To view the response result, add a listener. Right-click Thread Group, choose Add > Listener > View Results Tree, and add the view result tree to the thread group.Figure 6 Adding a view results tree
- (Optional) Import file variables, if any.
CSV files are supported. In a CSV file, variable names are in the first row, and data is in other rows.
Figure 7 A CSV fileThe following figure shows the variables in text format.
Figure 8 Variables in text formatRight-click Thread Group and choose Add > Config Element > CSV Data Set Config from the shortcut menu. Click Browse to select the target CSV file, and click Open to add the file.
Figure 9 Adding a variable fileTo test the effect of referencing variables, you can introduce variables to the HTTP header. A file in ${variable name} format tells JMeter that the variables are read from external systems.
Figure 10 Introducing variables to the header - Save the test plan file and debug the script.
Click
on the top of the page, specify the save path and file name, save the test task as a JMX file, and store the project file (JMX) and variable file (CSV) in the same directory. The name of a JMX file contains only letters, digits, hyphens (-), underscores (_), and periods (.). A JMX file with an invalid name cannot be imported to CodeArts PerfTest.
Click the green triangle button
on the top to execute the task. You can view the execution result in View Results Tree, including Request Body, Request Header, Response Body, and Response Header.
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