Creating a Test Task
Prerequisites
(Optional) A transaction has been added.
Procedure
- Log in to the CPTS console and choose CPTS Test Projects in the navigation pane on the left.
- Select a CPTS test project where you want to creat a test task and click Edit Test Task.
- On the Test Tasks tab, click Add Task.
- Enter a test task name and benchmark concurrency.
Benchmark Concurrency: Set a benchmark. It is used as a reference for setting the number of concurrent users in 8. Number of concurrent users = Benchmark Concurrency x Concurrency Percentage
- Select an execution mode and click OK.
There are two execution modes:
- Serial: Test cases in a test task are executed in sequence.
- Parallel: Test cases in a test task are executed concurrently.
- Click
to expand the new test task. Click Add Case on the Cases tab, configure the test case parameters by referring to Table 1, and click OK.
Table 1 Adding a case Parameter
Description
Case Name
Test case name.
Case Type
There are normal and preset test cases:
- Normal: You can add only normal transactions and HTTP/HTTPS/TCP/UDP requests to a normal case.
- Preset: A preset case is a prerequisite for a test task. It is executed first and only once when used with a normal test case. Cyclic execution is not supported.
Executors
The number of executors must be at least the maximum number of concurrent users in all phases/5000.
NOTE:This setting takes effect only with private resource groups.
- Add a request, data instruction, or transaction to the test task.
You can add both or either of requests and transactions to normal or preset cases. Data instructions usually work with requests.
- Add a data instruction: For details, see Adding a Data Instruction.
- Add a request: For details, see Adding Request Information (Packet), Adding Request Information (Think Time), Adding Request Information (Response Extraction), and Adding Request Information (Checkpoint).
- Add a transaction: When there are already transactions on the Transactions tab, click Add Transaction, select a transaction, and click OK. For details about how to create a transaction, see Adding Transactions.
- After a request, data instruction, or transaction is added, click Add Phase and set the phase parameters by referring to Table 2.Note
- A maximum of 1000 phases can be added to a normal case.
- Phases cannot be added to preset cases.
Table 2 Phase parameters Parameter
Description
Phase Name
Phases names are used to distinguish different phases. For example, you can set the name to Home page test.
Pressure Mode
The concurrency mode and TPS mode are supported.
- Concurrency Mode: The performance test is performed based on the number of concurrent users. The number of concurrent users can be a fixed number or can be set to ramp up throughout the phase.
- TPS Mode: The performance test is performed based on the number of transactions per second (TPS). In TPS mode, an execution of a test case by a virtual user is considered as a transaction. The actual TPS may not reach your specified value because it will be affected by the specified maximum number of concurrent users and the average transaction latency.
Execution Policy
The value can be Duration or Count.
- Duration: The performance test will be performed based on the specified duration.
- Count: The performance test will be performed based on the total number of transmissions.
When Pressure Mode is set to Concurrency Mode, Execution Policy is set to Duration, and Gradient Increment is disabled, you need to set the following parameters:
Benchmark Concurrency
The benchmark is used as a reference for setting the number of concurrent users. Number of concurrent users = Benchmark Concurrency x Concurrency Percentage
You can configure the benchmark when you create a test task, but the benchmark cannot be modified after the task creation.
Concurrent User
The number of concurrent users refers to the number of users performing operations on a system at the same time.
In CPTS, it is the number of virtual users you define when you configure a test phase.
Concurrency Percentage (%)
Ratio of Concurrent User to Benchmark Concurrency.
Duration (min)
Duration that the phase will last.
When Pressure Mode is set to Concurrency Mode, Execution Policy is set to Duration, and Gradient Increment is enabled, you need to set the following parameters:
NOTE:There can be only one phase whose Gradient Increment is enabled in a case.
Benchmark Concurrency
The benchmark is used as a reference for setting Start Concurrent User and Increasing Concurrent User.
You can configure the benchmark when you create a test task, but the benchmark cannot be modified after the task creation.
Start Concurrent User
Starting number of concurrent users for a ramp-up.
Start Percentage (%)
Ratio of Start Concurrent User to Benchmark Concurrency.
Increasing Concurrent User
Total number of concurrent users to be added. During a ramp-up, the starting number of concurrent users is simulated in the first subphase. Then the number of concurrent users is added by the amount of (Increasing Concurrent User x Increment) in each subsequent subphase. In the final subphase, the number of concurrent users will reach the amount of (Start Concurrent User + Increasing Concurrent User).
Incremental Percentage (%)
Ratio of Increasing Concurrent User to Benchmark Concurrency.
Increment
Number of concurrent users added in each subphase = Increasing Concurrent User x Increment.
The value can be 5%, 10%, 20%, and 50%.
Duration per Pressure Test (min)
Duration that each subphase will last.
When Pressure Mode is set to Concurrency Mode and Execution Policy is set to Count, you need to set the following parameters:
NOTE:You can add only one phase whose Execution Policy is Count in a case.
Benchmark Concurrency
The benchmark is used as a reference for setting the number of concurrent users. Number of concurrent users = Benchmark Concurrency x Concurrency Percentage
You can configure the benchmark when you create a test task, but the benchmark cannot be modified after the task creation.
Concurrent User
The number of concurrent users refers to the number of users performing operations on a system at the same time.
In CPTS, it is the number of virtual users you define when you configure a test phase.
Concurrency Percentage (%)
Ratio of Concurrent User to Benchmark Concurrency.
Total Number of Transmissions
When the task is running, the performance test in this phase will be executed repeatedly until the number of execution times reaches the specified value.
NOTE:The total number of transmissions must be greater than or equal to the number of concurrent users.
When Pressure Mode is set to TPS Mode and Execution Policy is set to Duration, you need to set the following parameters:
Max Concurrent User
Maximum number of virtual users for a test case.
TPS
Number of transactions executed per second.
Duration (min)
Duration that the phase will last.
When Pressure Mode is set to TPS Mode and Execution Policy is set to Count, you need to set the following parameters:
NOTE:You can add only one phase whose Execution Policy is Count in a case.
Max Concurrent User
Maximum number of virtual users for a test case.
TPS
Number of transactions executed per second.
Total Number of Transmissions
When the task is running, the performance test in this phase will be executed repeatedly until the number of execution times reaches the specified value.
NOTE:The total number of transmissions must be greater than or equal to the number of concurrent users.
- When the configuration is complete, click OK.
- Prerequisites
- Procedure