All Products
Search
Document Center

Performance Testing:Use a HAR file to quickly start stress testing

Last Updated:Nov 01, 2024

The HTTP Archive (HAR) format is a standard file format that is used to record information about HTTP requests and responses. Google Chrome, Charles, and Fiddler support the export of files in the HAR format. You can use the HAR file import feature to import the HTTP traffic that is recorded to a Performance Testing (PTS) stress testing scenario. This topic describes how to export a HAR file and then import the HAR file to the PTS console to perform stress testing.

Step 1: Export a HAR file

You can use Google Chrome, Charles, or Fiddler to export HAR files.

Method 1: Export a HAR file by using Google Chrome

  1. Open the Google Chrome browser.

  2. Enter the address of a web page in the address bar and go to the web page. On the web page that appears, perform an operation, right-click any area, and then select Check.

  3. In the panel that appears, click the Network tab and click the 图标 icon.image

Method 2: Export a HAR file by using Charles

  1. Open the Charles tool.

  2. Connect to the Charles proxy by using your mobile phone.

  3. On the Charles page, click the 1 icon to start recording.

  4. Access an application on your mobile phone and click the 1 icon to stop recording.

  5. On the Charles page, click File, select Export Session, and then click Save.

Method 3: Export a HAR file by using Fiddler

  1. Open the Fiddler tool.

  2. On the Fiddler page, select the API operation that you want to export.

  3. On the Fiddler page, click File, select Export Sessions, and then click Selected Sessions....

  4. On the Select Export Format page, select HTTPArchive v1.1 and click Next.

  5. After the preceding operations are complete, click Save.

Step 2: Use the HAR file to perform stress testing

  1. Log on to the PTS console. In the left-side navigation pane, choose Performance Test > Create Scenario. On the Create Scenario page, click HTTP Archive Format(.har).

  2. In the Import API files dialog box, upload the exported HAR file. The size of the HAR file that you upload must be less than 10 MB.image

  3. After the HAR script is uploaded, the system automatically orchestrates the related stress testing scenario.image

  4. Configure stress mode settings.

    Set the maximum number of virtual users (VUs) to 10 and the total test duration to 1 minute. Use the default settings for other parameters. You are charged for stress tests. We recommend that you configure a load level based on your business requirements. For more information, see Billing overview and Configure the stress testing model and level. image

  5. Debug the stress testing scenario and start stress testing.

    1. Debug the stress testing scenario. We recommend that you debug the stress testing scenario before you start stress testing. This helps check whether the configurations meet your business requirements and ensure the success of stress testing.

    2. In the lower part of the Edit Scenario page, click Save and Start. In the Note dialog box, set the Execution Cycle parameter to Execute Now, select the check box for The test is permitted and complies with the applicable laws and regulations, and then click Start Test.

Analyze the stress testing results

After the stress test is complete, the system obtains the data generated during the test, such as the stress testing scenario metrics, business details, monitoring details, and API sampling logs, and then generates a stress testing report. You can view the report on the Reports page. For more information, see View a PTS-based stress testing report. image