Updated on 2024-04-25 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, system 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 encapsulate multiple test steps as common test logic. This test logic can be reused when the combined keywords are invoked by other test cases.
  • System keywords cover authentication, protocols, middleware, and database, for various scenarios such as identity authentication, complex protocols, data processing, data preconfiguration, data verification, and API integration.

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.
    • Practical keyword types such as authentication, database operation, middleware, and protocol are placed on the System tab page. For details, see API automation keywords.

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