Updated on 2023-11-28 GMT+08:00

Keyword Library

Background

Keyword-driven testing is a test automation technique that creates automated test cases by providing a set of "build blocks" called keywords. Keyword-driven testing can be used at different test levels, such as component testing and system testing. Its advantages lie in usability, understandability, maintainability, reuse of test information, support for test automation, saving potential costs, and promoting progress.

When designing test cases, you may often use the same preparations or test logic. If these steps are written in each test case, the workload is heavy and the maintenance is difficult. Test keywords can help reuse these test steps.

Keyword Library manages API keywords and combined keywords in a unified manner to build one-stop keyword management capabilities and ensure consistent user experience during test case scripting.

API keywords define the request of a single API, and can be generated by importing a Swagger file or saving a user-defined URL request. Combined keywords are used to encapsulate common test logic for multiple steps and can be invoked by test cases to implement logic reuse.

Procedure

  1. After the operations described in Creating an API Automation Test Case are complete, choose Testing Case > Auto API Test and click the name of the test case to be edited.
  2. Click the Scripting tab. Keyword Library is displayed on the right of the page. (If it is not displayed, click .)

    • The Swagger import keywords are placed on the API tab page. For details, see API Keywords.
    • Keyword test cases and combined keywords are placed on the Combine tab page. You can create combined keywords. For details, see Combined Keywords.

Click the drop-down list on the API tab page and search for keywords by Name, Desc, or Address.