Help Center> CodeArts TestPlan> User Guide> Testing Case> API Automation Test Cases> Importing cURL to Generate Test Scripts
Updated on 2024-04-25 GMT+08:00

Importing cURL to Generate Test Scripts

Background

cURL is a command-line tool for transferring data specified with URL syntax. API automation allows you to copy the cURL of an API request from the Chrome control panel and paste the cURL to automatically generate an API test script.

Procedure

  1. After the operations described in Creating an API Automation Test Case are complete, click the test case name, and click the Scripting tab.
  2. Use a new browser tab to open the web page of the API to be tested and press F12 to open the control panel.
  3. Click the Network tab, right-click the API request in the list, and choose Copy > Copy as cURL (bash) from the shortcut menu.

  4. Return to the Scripting tab, right-click the blank area on the page, and choose Add Control > cURL from the shortcut menu.

    The test script is automatically generated on the page.