🪧API Automation Template

This document provides a detailed explanation of the fields present in the API Test Case Template. The template is structured to capture essential information required for API testing, ensuring that tests are robust, accurate, and comprehensive.

DEPENDANT_TEST_CASE,
END_POINT,
METHOD,
PARAMS:KEY,
PARAMS:VALUE,
AUTH:KEY,
AUTH:VALUE,
HEADERS:KEY,
HEADERS:VALUE,
BODY:KEY,
BODY:VALUE,
RESPONSE:CODE,
RESPONSE:JSON_PATH,
RESPONSE:EXPECTED_VALUE,
RESPONSE:STORE_VALUE,

File name:

The template is added in the file with file name TestCaseID_GroupName.csv. The file TestCaseID_GroupName.csv is a CSV (Comma-Separated Values) file designed to store and organize test case data systematically within a test management framework. It consists of:

  • TestCaseID: This is a unique identifier assigned to each test case, facilitating the tracking of each test's execution status and results throughout the testing lifecycle.

  • GroupName: This specifies the category of the test suite to which the test cases belong, such as sanity, regression, or smoke tests. The grouping aids in organising the test cases by their testing objectives and in streamlining the execution of related test sets.

Fields in the Template

1. DEPENDANT_TEST_CASE

  • Description: Specifies any preceding test case that the current test case is dependent on.

  • Format: Test case ID or name.

  • Example: TestManagementID_GroupName.csv

2. END_POINT

  • Description: Represents the API endpoint that needs to be hit.

  • Format: URL path.

  • Example: https://api-generator.retool.com/8pwBcI/data/

3. METHOD

  • Description: Specifies the HTTP method used for the API call.

  • Format: GET, POST, PUT, DELETE, etc.

  • Example: POST

4. PARAMS:KEY & PARAMS:VALUE

  • Description: These fields capture the key-value pairs for query parameters passed in the API call.

  • Format: Key and corresponding value.

  • Example: filter, active

5. AUTH:KEY & AUTH:VALUE

  • Description: Used for any authentication information, like API tokens or credentials.

  • Format: Type of authentication and its value.

  • Example: Bearer, your_api_token_here

6. HEADERS:KEY & HEADERS:VALUE

  • Description: Represents the key-value pairs for headers passed in the API call.

  • Format: Header key and its corresponding value.

  • Example: Content-Type, application/json

7. BODY:KEY & BODY:VALUE

  • Description: Denotes the key-value pairs to be included in the request body, especially relevant for POST and PUT methods.

  • Format: Key and the associated value.

  • Example: username, john_doe

8. RESPONSE:CODE

  • Description: Expected HTTP status code in the response.

  • Format: Numeric HTTP status code.

  • Example: 200

9. RESPONSE:JSON_PATH

  • Description: JSON path expression to navigate to a specific portion of the response for validation.

  • Format: JSON path expression.

  • Example: data.id

10. RESPONSE:EXPECTED_VALUE

  • Description: The expected value at the specified JSON path in the response.

  • Format: Desired value.

  • Example: 12345

11. RESPONSE:STORE_VALUE

  • Description: If any value from the response needs to be stored for use in subsequent test cases, it can be specified here.

  • Format: Variable name or reference.

  • Example: session_id


Conclusion

This API Test Case Template is structured to ensure thorough and effective testing. By following this template and accurately filling out each field, testers can ensure that APIs are tested comprehensively, with a clear understanding of dependencies, requests, and expected outcomes.

Last updated

Was this helpful?