Build-Test-Script

Build and Execute Test script.

Test Script Info

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

Field
Description

API type

Select REST, SOAP or GraphQL.

Name

The name of your API script.

Description

A description of your script.

Context Path

The path to your specific API.

Protocol

Defines a set of rules for communication( http/https).

Endpoint

URL where a service or resource can be accessed.

Port Number

It is network address. For example: 8080.

Verbs

The type of API call. GET, POST, PUT, DELETE or PATCH.

Timeout

Timeouts are used to avoid waiting APIs response.

URL in code Enabled

Encoding special characters within the URL.

image

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

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

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.

    image

    You can remove headers by clicking on the delete icon.

    image

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.

    image
  • Using Path Parameter in Test Script:

    image

    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.

    image

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.

    image
  • You can remove Query Parameters by clicking on the delete icon.

    image

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.

image

Assertions

  • Within the realm of API testing, assertions encompass statements or conditions that verify if the real results of API requests and responses align with the anticipated outcomes.

  • Various categories of assertions supported within Functional Testing:

    • Functional Assertions: Within API testing, Functional Assertions encompass a diverse range of validation techniques. These assertions serve the purpose of confirming the alignment between the anticipated and actual API responses. The supported assertions encompass aspects like Headers, JSON Path, XPATH, body content, and schema validation. For more comprehensive understanding Click Here

    • API to DB assertion: Within API testing, Functional Testing provides an array of assertions for API-to-DB validation, ensuring that API responses align as expected with corresponding database resources. For more comprehensive understanding Click Here

Execute Test Script

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

image

Step-2 : Select the Environment name.

image

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

Step-4 : It will be navigated to Reports Page.

Last updated