Create a stress testing scenario

Updated at:

Creating a stress testing scenario is the first step in using PTS stress testing. This topic describes what a stress testing scenario is and shows you how to create one.

Background

Performance Testing Service (PTS) is a proprietary tool from Alibaba's full-link stress testing platform. PTS supports performance testing over HTTP and HTTPS. It is widely used for web applications and mini programs across various industries, including e-commerce, Internet of Vehicles (IoV), multimedia, finance, logistics, advertising, and social media. PTS simulates real-world business scenarios with massive user traffic to comprehensively validate the performance, capacity, and stability of your services.

What is a stress testing scenario?

To run a performance test, first create a stress testing scenario. A stress testing scenario consists of one or more business processes that run in parallel. In PTS, these are called serial links. Each business process contains one or more requests that run in sequence. In PTS, these are called APIs.

  • A stress testing scenario must include at least one API. An API defines the specific URL details for each step within a serial link. It is a client-side request triggered by a user action. For example, on an e-commerce website, user actions like logging in, viewing product details, or submitting an order each correspond to one or more API requests.

  • A serial link is an ordered collection of APIs that represents a meaningful business process, similar to a transaction.

The following example illustrates the relationship between serial links and APIs.

For example, suppose you need to test two business processes on Taobao's website simultaneously. These two processes would be configured as two separate serial links:

  • Business A: Browse Product A.

  • Business B: Purchase Product B.

Business B involves four sequential requests. These four requests are configured as four separate APIs:

  • Request 1: Log in.

  • Request 2: Browse Product B.

  • Request 3: Add to cart.

  • Request 4: Submit order.

The following example shows how this stress testing scenario is configured.

On the scenario configuration tab in the PTS console, Serial Link 1 for Browse Product A corresponds to a single GET request. Serial Link 2 contains four APIs: Log in (GET), Browse Product B (PUT), Add to cart (POST), and Submit order (GET). Under each serial link, you can click +API Template or +Add Test API. At the bottom of the page, you can click +Add Serial Link.

Procedure

  1. Log in to the PTS console. In the left navigation bar, select Performance Testing > Create Scenario, and then click PTS Stress Test.

  2. On the scenario configuration tab, click the fj icon next to add stress testing node to add multiple APIs to a serial link. When the test starts, the APIs send requests in sequence. For more information, see HTTP node overview.

    Note

    If you click add stress testing node directly, an HTTP stress testing node is added by default.

  3. Optional:

    Click +Add Serial Link to add multiple serial links to the scenario. When the test starts, the serial links run in parallel.

  4. Configure parameters on the other tabs:

  5. While creating the PTS scenario, you can also do the following:

    • To debug the scenario, click debug scenario in the lower-left corner of the scenario configuration tab. For more information, see Scenario debugging.

    • After you finish the configuration, click Save and start test in the lower-left corner of the scenario configuration tab to start the test. For more information, see TPS adjustment.

Use cases

You can run a PTS stress test by following a few simple steps in the PTS console. The following topics provide examples for specific use cases:

Next steps

After you create a scenario, go to the scenario list page and select PTS to view your PTS scenarios.

In the Actions column for a scenario, you can do the following:

  • Click Start to run the performance test. For more information, see TPS adjustment.

  • Click Edit to open the Edit scenario page, where you can modify the scenario configuration. PTS provides several other features to improve your efficiency, such as copying scenarios, enabling or disabling serial links, and copying APIs. For more information, see Manage scenarios.

  • Click Delete to delete the stress testing scenario. Previously generated PTS stress testing reports remain available. For more information, see View a PTS stress testing report.

  • Click Copy to create a duplicate of the scenario. For more information, see Manage scenarios.