# API Test Report

### Overview

This document aims to align the test case execution report with the corresponding API template used in scriptless automation. It will detail how each element of the API call template is reflected and validated in the execution report.

### Structure of the API Template

The API template is a predefined CSV format that outlines the parameters and expected outcomes for an API call. Below is the template structure:

```
DEPENDANT_TEST_CASE,NONE,
END_POINT,https://api-generator.retool.com/7kbSLy/data,
METHOD,POST,
PARAMS:KEY,NONE,
PARAMS:VALUE,NONE,
AUTH:KEY,NONE,
AUTH:VALUE,NONE,
HEADERS:KEY,Content-Type,
HEADERS:VALUE,application/json,
BODY:KEY,JsonRepository,name
BODY:VALUE,test,Custom:CustomClass:body
RESPONSE:CODE,201,
RESPONSE:JSON_PATH,'Column 1',id
RESPONSE:EXPECTED_VALUE,PrecisionTestAutomation1,NONE
RESPONSE:STORE_VALUE,Name,ID
```

### Alignment with the Execution Report

Each parameter in the API template corresponds to an entry in the test case execution report, which logs the process and outcomes as follows:

#### Info Entries

* **END\_POINT**: The report logs the API endpoint URL used for the POST request.
* **METHOD**: The HTTP method (`POST`) is recorded.
* **HEADERS**: The `Content-Type` header set to `application/json` is listed.
* **BODY**: The source (`JsonRepository`) and the key for the dynamic body content are noted.

The `PARAMS:KEY`, `PARAMS:VALUE`, `AUTH:KEY`, and `AUTH:VALUE` are not used in this test case, so they are not logged in the report, aligning with the template where their values are set to `NONE`. If these parameters are used then they added in INFO entires

#### Validation Entries

* **RESPONSE:CODE**: The report validates that the HTTP status code received (`201`) matches the expected status code.
* **RESPONSE:JSON\_PATH** and **RESPONSE:EXPECTED\_VALUE**: The report verifies that the value for `Column 1` matches the expected value `PrecisionTestAutomation1`.

The result of each validation is marked as 'Pass' if the actual outcome meets the expectation. Otherwise, it would be marked as 'Fail'.

### Conclusion

The test case execution report serves as a direct reflection of the API call template, documenting each significant step and validating the outcomes against the expected values. This report provides a transparent and detailed account of the test execution, allowing users to verify the integrity of the API call and its compliance with the defined requirements. The alignment between the template and the report ensures a clear and concise representation of the test case, facilitating easy review and troubleshooting.

<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.precisiontestautomation.in/scriptlessautomation/automation-platforms/scriptlessapi-automation/api-test-report.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
