Updated on 2024-10-11 GMT+08:00

Adding an API Script by cURL

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 Automated API Test Case Template 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.