# Build Test script

### Build and Execute Test script.

#### Test Script Info

Step-1 : Select the type of API you'll be testing (REST, SOAP, GraphQL).

***

#### Authorization:

Authorization in the context of APIs refers to the process of granting or denying access to specific resources, data, or functionalities within an API.

**Type 1: Basic Authentication**

&#x20;**Step 1:** Choose the **Basic Auth** option.

**Step 2:** Provide the following credentials:

* Enter authorized API **Username**.
* Enter your Corresponding **Password**.

**Type 2: OAuth 2.0 Authentication**

&#x20;Step 1 : Select the "OAuth 2.0" option.

Step 2 : Depending on the token retrieval method, do one of the following:

**Option A: Access Token in Headers**

Step-1 : Enter the **Access Token** to be added to headers.

Step-2 : Save the TestScript.

* After saving the access token, it will be added in headers part along with prefix **Bearer**.

**Option B: Access Token in Query Parameters**

Step-1 : Enter the **Access Token** to be added to queryParams.

Step-2 : Save the TestScript.

* After saving the access token, it will be added in query params.

**Select Certificate**

**Click here to check out option to upload Certificate**

***

### Headers and Params:

#### Headers

Headers consist of key-value pairs that provide additional information about the request or the client.

* **Key-Value Pair:** Headers convey metadata, authentication tokens, content type, and more to the server.

  You can remove headers by clicking on the delete icon.

#### Path Parameter:

Path parameters are placeholders in the URL path that are replaced with actual values.

* Provide **Parameter Name, Parameter Value, Parameter Type** details.
* As they allow dynamic and resource-specific interactions, such as accessing specific endpoints or records.
* Using Path Parameter in Test Script:

  **Note**: The name of the path parameter stated in both the Header and Params section must match the path parameter name utilized in the **Info** of your Test Script.
* Path parameters can be removed by clicking on Delete Icon.

#### Query Parameter:

Query parameters are appended to the URL and are used to modify the request or filter responses.

* Provide **Parameter Name, Parameter Value, Parameter Type** details.
* As they enable filtering, sorting, and customizing requests to retrieve specific data.
* You can remove Query Parameters by clicking on the delete icon.

***

### Body

* The payload of data sent in the request's body.
* Typically used for POST, PUT, DELETE, and PATCH requests to send data to the server.
* It include information like JSON objects, XML, or form data that the API endpoint expects.

***

### Execute Test Script

Step-1 : Click on **Play icon** to execute test.

Step-2 : Select the Environment name.

Step-3 : Then select desired Environment & click on the **Run** button.

Step-4 : It will be navigated to reports page.
