# Functional-Testing

### Functional Testing

* Functional testing refers to the process of testing the individual functions, interactions, and behavior of an API to ensure that it meets the specified requirements and functions correctly.

#### Contents

* [Introduction To Functional Testing](#introduction-to-functional-testing)
* [Project Creation](#project-creation)
* [Create Test Suite](#create--test-suite)
  * [Edit Test Suite](#edit-test-suite)
  * [Delete Test Suite](#delete-test-suite)
  * [Summary of Test Suite](#summary-of-test-suite)
* [Test Script Creation](#test-script-creation)
  * [Import Swagger JSON or WSDL URL](#import-swagger-json-or-wsdl-url)
  * [Upload Swagger JSON or WSDL File](#upload-swagger-json-or-wsdl-file)
  * [Import from Postman Collection URL](#import-from-postman-collection-url)
  * [Upload from Postman Collection File](#upload-from-postman-collection-file)
  * [Create Manual API](#create-manual-api)
  * [Summary of Test Script Creation](#summary-of-test-script-creation)
* [Build Test Script](#build-test-script)
  * [Info](#info)
  * [Authorization](#authorization)
  * [Headers and Params](#headers-and-params)
  * [Body](#body)
  * [Assertions](#assertions)
* [Execute Test Script](#execute-test-script)
* [Functional Reports](#functional-reports)
* [Advanced Features](#advanced-features)

***

#### Introduction To Functional Testing

* Let's pause for a moment to comprehend the benefits that Functional Testing provides in the realm of API Testing Services. Functional Testing serves the purpose of testing REST, SOAP, and GraphQL APIs. To accomplish this, the user is required to furnish API details, authorization, headers, path parameters, query parameters, functional assertions, and API-to-DB assertions.
* To enhance the user experience, we offer tools such as JSON path extractors, XPATH extractors, JSON and XML schema generators. Upon executing the test script, users can view the generated report, which allows them to verify the results effectively.

***

### Project Creation

[**Click here for instructions on how to Create Project**](https://docs.qyrus.com/api-testing/getting-started/project-creation-for-api)

***

#### Create Test Suite

Once the project is created, you'll be redirected to the dashboard.

Step 1: Click on **Create Test Suite**

![image](https://2173886669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrWgLy70uByJZz2Zz3InN%2Fuploads%2Fgit-blob-6ebea900f33f720d5fc37e8973e8eb4d5f6aa097%2FCreate_Test_Suite.png?alt=media)

Step 2: Enter **Test Suite Name**, **Module name**, and click on **Create Test Suite** button.

**NOTE**:

* The Test Name can have only letters, numbers, and underscores.
* Module name should not exceed 225 characters

  ![image](https://2173886669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrWgLy70uByJZz2Zz3InN%2Fuploads%2Fgit-blob-90f3344ab5922d9e13a0fd58772d5394ff65a40c%2FCreate_Test_Suite_Popup.png?alt=media)

***

**Edit Test Suite**

Step 1: Go to the desired Test Suite.

Step 2: Click on **Edit Suite** icon.

![image](https://2173886669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrWgLy70uByJZz2Zz3InN%2Fuploads%2Fgit-blob-37295749709ff2c8d2e9d2c211aaf5caabc6ce44%2FEdit_Test_Suite.png?alt=media)

Step-3: Enter necessary **Test Suite Name** or **Module Name**, then clicks on **Update**.

![image](https://2173886669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrWgLy70uByJZz2Zz3InN%2Fuploads%2Fgit-blob-25afeb9b4cbfc69fb41d7d4c2a8719c5c70e2d97%2FEdit_Test_Suite_Popup.png?alt=media)

***

**Delete Test Suite**

Step-1: Go to the desired Test Suite.

Step-2: Click on the **Delete** icon.

![image](https://2173886669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrWgLy70uByJZz2Zz3InN%2Fuploads%2Fgit-blob-9a8c4c1e6a09936da9014684d9ca74e97b61418e%2FDelete_Test_Suite.png?alt=media)

Step-3: Confirm the deletion.

![image](https://2173886669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrWgLy70uByJZz2Zz3InN%2Fuploads%2Fgit-blob-f3f94acf3dbf5ba59e56a8bd91d943ab043b368b%2FDeleteSuitePop.png?alt=media)

***

**Summary of Test Suite**

![Watch this video for instructions on how to create,edit and delete test suites](https://2173886669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrWgLy70uByJZz2Zz3InN%2Fuploads%2Fgit-blob-9316e2c70d922f2ad4fa131344c75a7cd2d2e0bb%2FTest_suite_Creation.gif?alt=media)

***

#### Test Script Creation

The options available for API creation in Functional Testing that we offer:

* [Import Swagger JSON or WSDL URL](#import-swagger-json-or-wsdl-url)
* [Upload Swagger JSON or WSDL File](#upload-swagger-json-or-wsdl-file)
* [Import from Postman Collection URL](#import-from-postman-collection-url)
* [Upload from Postman Collection File](#upload-from-postman-collection-file)
* [Create Manual API](#create-manual-api)

#### Import Swagger JSON or WSDL URL

Generate a test script by Importing Swagger JSON or WSDL URL

* For example, you can utilize this open API:

  ```
     https://petstore.swagger.io/v2/swagger.json
     
  ```

Step-1: Provide valid Swagger JSON or WSDL URL in the field.

Step-2: Then, click on **Get API's** to get APIs from provided URL.

![image](https://2173886669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrWgLy70uByJZz2Zz3InN%2Fuploads%2Fgit-blob-5c5e32df8cbcf38c98059504b60769ce93e89b2e%2FImport_Swagger_Url.png?alt=media)

Step-3: Select required API's to be generated as Test Script. And click on **Generate Test Script**.

![image](https://2173886669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrWgLy70uByJZz2Zz3InN%2Fuploads%2Fgit-blob-8457b879d45e9762d5a41b25cebd907db0c0073b%2FGenerate_Test_Script_through_Swagger_Url.png?alt=media)

Step-4: If all processes occur as intended, the resulting list will display the generated Test Scripts as shown below.

![image](https://2173886669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrWgLy70uByJZz2Zz3InN%2Fuploads%2Fgit-blob-8e73907588ae9558c58f5d869c6c207f253e5d90%2FAfterImport.png?alt=media)

***

#### Upload Swagger JSON or WSDL File

Step-1: In the **Upload Swagger JSON or WSDL File** section click on **Browse** button and select the desired Swagger JSON or WSDL file.

![image](https://2173886669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrWgLy70uByJZz2Zz3InN%2Fuploads%2Fgit-blob-11b8dc20a41a61f6cdebfc7aa00e50bbe5e5b085%2FUpload_Swagger_Json_File.png?alt=media)

Step-2: Then Select API's to **generate test script**.

![image](https://2173886669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrWgLy70uByJZz2Zz3InN%2Fuploads%2Fgit-blob-8457b879d45e9762d5a41b25cebd907db0c0073b%2FGenerate_Test_Script_through_Swagger_Url.png?alt=media)

Step-3: If all processes occur as intended, the resulting list will display the generated Test Scripts as shown below.

![image](https://2173886669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrWgLy70uByJZz2Zz3InN%2Fuploads%2Fgit-blob-8e73907588ae9558c58f5d869c6c207f253e5d90%2FAfterImport.png?alt=media)

***

#### Import from Postman Collection URL

For example, you can utilize this open API:

```
https://www.postman.com/collections/aa23bc182d99b5f6f93c
```

Step-1: Please input the provided URL into the designated field labeled **Import From Postman Collection**

Step-2: Click on **Get API's** to retrieve the relevant APIs

![image](https://2173886669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrWgLy70uByJZz2Zz3InN%2Fuploads%2Fgit-blob-6937c4ffad012ada057e6bebb90be8e309b786c1%2FImport_API_From_Postman.png?alt=media)

Step-3: Select the API's and **Generate Test Script**.

![image](https://2173886669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrWgLy70uByJZz2Zz3InN%2Fuploads%2Fgit-blob-7b822f5d69dc63d892d83f3cf5c3024eee215c0d%2FPostman_URL_Select_API's.png?alt=media)

Step-4: If all processes occur as intended, the resulting list will display the generated Test Scripts as shown below.

![image](https://2173886669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrWgLy70uByJZz2Zz3InN%2Fuploads%2Fgit-blob-d2fd4dd15e9ca57986742cc1d816e1726f7c1098%2FPostman_url_After_Import.png?alt=media)

#### Upload from Postman Collection File

Step-1: In the **Import from Postman Collection** section click on **Upload Json File** button and select the desired postman collection JSON file.

![image](https://2173886669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrWgLy70uByJZz2Zz3InN%2Fuploads%2Fgit-blob-3557ea6d32efcffd17b85247294b665f49593ba6%2Fimport_postman_file.png?alt=media)

Step-2: Then Select API's to **generate test script**.

![image](https://2173886669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrWgLy70uByJZz2Zz3InN%2Fuploads%2Fgit-blob-7fe430dad9f5f6ef4977e4e7c5f6a4a504b942a3%2Fpostman_file_select_API.png?alt=media)

Step-3: If all processes occur as intended, the resulting list will display the generated Test Scripts as shown below.

![image](https://2173886669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrWgLy70uByJZz2Zz3InN%2Fuploads%2Fgit-blob-b4620f15e95bc988e24ada2f61f5ebcbc38e19f5%2Fpostman_file_After_import.png?alt=media)

***

#### Create Manual API

* To create a manual API Test, click on **Add** button in the **Create Manual API Test** section.

  ![image](https://2173886669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrWgLy70uByJZz2Zz3InN%2Fuploads%2Fgit-blob-34e4ab4082d70ffb3a7396b5c07b238868fba24b%2FCreate_Manual_API.png?alt=media)
* To create an API manually, it's essential to provide the required information outlined [here!](https://docs.qyrus.com/api-testing/functional-testing/build-test-script)
* Once required API details are provided, click on **Save** to save the Test Script.

***

#### Summary of Test Script Creation

![Watch this video for instructions on Test script](https://2173886669-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FrWgLy70uByJZz2Zz3InN%2Fuploads%2Fgit-blob-6729258ac5a79d1d78b9641cebe852e12c2c7e6b%2FTest_Script_Creation.gif?alt=media)

***

Now, let's comprehensively grasp the process of building and executing test scripts, including a thorough explanation of all the supported options.

#### Build Test Script

To Build and Execute Test Script [Click here!](https://docs.qyrus.com/api-testing/functional-testing/build-test-script)

Interested in gaining a more detailed understanding of Test Script? Below is a comprehensive list of Test Script's details.

**Info**

* [Additional insight regarding the **Info** aspect of Test Scripts](https://docs.qyrus.com/api-testing/build-test-script#test-script-info)

**Authorization**

* [Additional insight regarding the **Authorization** aspect of Test Scripts](https://docs.qyrus.com/api-testing/build-test-script#authorization)

**Headers and Params**

* [Additional insight regarding the **Headers and Params** aspect of Test Scripts](https://docs.qyrus.com/api-testing/build-test-script#headers-and-params)

**Body**

* [Additional insight regarding the **Body** aspect of Test Scripts](https://docs.qyrus.com/api-testing/build-test-script#body)

**Assertions**

* [Additional insight regarding the **Assertions** aspect of Test Scripts](https://docs.qyrus.com/api-testing/build-test-script#assertions)

***

#### Execute Test Script

* [Additional insight regarding the **Execution** aspect of Test Scripts](https://docs.qyrus.com/api-testing/build-test-script#execute-test-script)

***

#### Functional Reports

* API testing reports provide insights into functional behavior of your APIs during testing.
* To gain insights of the reports, please navigate to the [Functional Reports](https://docs.qyrus.com/api-testing/functional-testing/report) page.

***

#### Advanced Features

1. **Parametrization:**
   * Explore [Parametrization](https://docs.qyrus.com/api-testing/functional-testing/parameterization) to gain a deeper understanding of its functionality.
2. **Compare and download functional reports**
   * To observe the reports comparison between two API's kindly go through [Compare and Download Functional Reports](https://docs.qyrus.com/api-testing/advanced-features#compare-and-download-functional-reports).
3. **Execute Multiple Test Scripts**
   * This feature allows you to [Execute Multiple Test Scripts](https://docs.qyrus.com/api-testing/advanced-features#execute-multiple-test-scripts).
4. **Execute Multiple Test Suites**
   * Functional Testing provides an advanced capability that enables the simultaneous [Execution of Multiple Test Suites](https://docs.qyrus.com/api-testing/advanced-features#execute-multiple-test-suites).

***

Related Topics:

* [Project Set Up](https://github.com/QQyrus/API-Testing-User-Documentation/blob/QA/Functional-Testing/Project-Setup/Project-Set-Up.md)
* [Execute JavaScript](https://github.com/QQyrus/API-Testing-User-Documentation/blob/QA/Functional-Testing/Advanced-Features/Execute-Javascript.md)
* [Emailing & Downloading Report](https://github.com/QQyrus/API-Testing-User-Documentation/blob/QA/Functional-Testing/Advanced-Features/Emailing-&-Downloading-Report.md)
