After you configure a stress testing scenario, you can debug the scenario to validate the configuration and prevent test failures. This topic describes how to debug Performance Testing (PTS) and JMeter scenarios.
Prerequisites
You have created a PTS or JMeter scenario. For more information, see Create a PTS scenario or Create a JMeter scenario.
Procedure
-
Log on to the PTS console and choose .
-
In the Actions column of the target scenario, click Edit to open the Edit Scenario page. Then, click Debug to debug the entire scenario.
During the debugging process, you can click the
icon in the upper-right corner to minimize the window. A floating window appears in the lower-right corner, allowing you to monitor the debugging status. Click the floating window to restore the Debug Scenario dialog box. -
In the debugging results, you can view the request logs for all requests. Click an API to view its debugging details.
If you need to debug only a single API, you can also go to the scenario settings page and click Debug API to the right of the API to view its debugging results.
ImportantDebugging a single API in a VPC is not supported. To debug a scenario in a VPC, click Debug to debug the entire scenario.
PTS scenario
On the PTS scenario debugging interface, the left side displays the serial execution list, which shows the execution status of each API: a green dot indicates success, and a red dot indicates an exception. If an assertion fails, the interface displays the message: "Assertion failed, so subsequent requests are not sent." The General section on the right shows information such as Request URL, Request Method, Response Code, Export Content, and Check Result JSON. Below this section are three tabs: request details, response details, and Timing. On the response details tab, you can expand sections to view checkpoint information, the response header, the response body, and error information. When a request is abnormal, the error information section displays specific details, such as IllegalArgumentException: forbidden uri, uri host must match vpc cidr pattern 10.0.0.0/8, 172.16.0.0/12. This indicates that the host of the request URI must match the specified VPC CIDR patterns.
-
Assertion results
An 'x' icon indicates an exception. Select the API to view the response details on the right.
-
Response status
The status can be a status code (such as 200, 302, 403, 503, or 500) or an Abnormal message. An Abnormal message means no response was received. This may be caused by a request timeout or an error in the request URL or body, such as an unrecognized function or an invalid URL format.
NoteYou can view the request and response details for each debugged API. To troubleshoot these issues, check the following:
-
If the response status is Abnormal, check the exception details in the error information section of the Response Details tab. For example, the exception can be caused by invalid parameters, such as the invalid use of a system function.
-
If the response status is a status code other than 200, check the returned information and perform standard troubleshooting by using the logs on your server.
-
If an assertion fails, check the assertion details in the Check Point Information section of the Response Details tab. If the current value is empty, no output parameter value was extracted.
-
-
Error information
This section displays details about abnormal responses, such as timeouts, parameter errors, or connection rejections.
-
The Timing tab details the time taken during the core lifecycle of a request.
You can use the Timing waterfall model to view error information. All errors appear in the Timing waterfall model.
For example, if you enable 302 redirection in the scenario settings, you can check the Timing waterfall model to see if a redirect occurred and its specific path.
-
Test an output parameter expression
When you need to extract a specific string from the response details of a request, typically from a text-based response body, you can test a regular expression in the debugging window to check if it is correct. You can also reset the output parameter as needed.
NoteThis feature is not available for JSON formats of the application/json and text/json types because these formats are easy to parse.
-
In the Debug Scenario dialog box, select an API on the right and click Click to test the regular expression for the output parameter.
-
In the Test output parameter regular expression dialog box, select a source format, enter a regular expression, and specify the Nth match. Then, click Test Expression. Use the matching result in the response details to verify that the extracted content is as expected.
-
If you need to reset the output parameter, click Sync Output Parameter to synchronize the regular expression to the output parameter list of the API.
NoteIf you synchronized an output parameter during debugging, return to the scenario settings tab of the stress testing scenario and set a name for the output parameter on the Output Parameter Definition tab of the API.
-
JMeter scenario
The engine logs panel on the right displays the JMeter engine startup logs, including runtime environment information such as the version number, JDK version, operating system, maximum memory, and the number of available processors. In the lower-right corner, the Architecture Topology area displays the architecture topology.
Click a Sampler to view the details of requests and responses and the Timing waterfall model in the sampling log area.
-
Sampling log:
-
The General tab displays the request URL, request method, and request status code.
-
The request details tab displays the request headers, body, and the original packet.
-
The Response Details tab displays the response headers, body, and the original packet.
-
The Timing tab displays the time taken for each API.
-
-
The Engine Logs area displays the JMeter runtime logs. If no sampling log is generated after you debug the script, you can analyze and troubleshoot issues using the error information in the engine logs. For more information about common errors and their causes, see Common Errors.