Test_Script
Last updated
Last updated
On selecting required project from project dashboard, you'll arrive at the Collections Dashboard. If you've already created collections, they will be listed here. Otherwise, let's begin by creating a new collection. Now Let's get started with creating Test Script.
You will be provided with below mentioned options to create Test Script in respective collection.
To bring APIs from the Qyrus API Testing Service into your Test scripts, follow these steps. Choose the Import from API Testing option and then proceed to click on the Import button, as depicted below.
At this point, you will see a list of all the teams and their associated projects that are accessible to the current user. Choose the Project from which you want to import scripts.
Now, you will be presented with a list of all the available Test Suites within the selected Project. Please select the Test Suite from which you want to import scripts.
Now, you will be listed will all the Test Scripts available in selected Test Suite.
Note: API Monitoring does not support Parameterized Test Scripts, as a result related data will be not imported.
Now, choose the Test Script you want to import, then click on the Create Monitored APIs button.
After successfully importing the Test Script, you will be directed back to the Test Scripts dashboard, accompanied by a confirmation message for Collection Creation saying APIs imported Successfully.
To create a API manually, follow these steps. Choose the Create Monitored API Manually option and then proceed to click on the Create Monitored API Manually button, as depicted below.
You can provide required details to create the Script, listed below.
Details required to be provided in Monitored API Form.
API type
Select REST, SOAP or GraphQL.
Monitor Name
This is the name of your Monitored API.
URL
This is your API's URL. Please incorporate any path and query parameters as needed. If you are utilizing the output from a prerequisite API as input for a path parameter, enclose the path parameter within curly braces. Example: https://www.yourURL.com/test/this/{airport} When employing a prerequisite API, the output of the prerequisite will be inserted into the {airport} field.
Time Period( Minimum 10 mins)
These fields allow you to specify the time interval between your API calls. You can select the time unit (minutes, hours, or days) from the dropdown menu. The shortest permissible time between calls is 10 minutes.
Time Unit
You can select the time unit (minutes, hours, or days) from the dropdown menu.
Single Response Time Threshold( ms)
Set this value to the maximum acceptable response time for your API call. The API monitoring service will monitor how many times this threshold is exceeded.
Receive Alert When Single Threshold Exceeded
If you select the 'Yes' option for the radio button, you will receive an email notification when a previous response call exceeds the specified threshold.
Average Response Time Threshold( ms)
The maximum acceptable average response time across a specified number of calls.
Receive Alert When Average Threshold Exceeded
If you select the 'Yes' option for the radio button, you will receive an email notification when a previous response call exceeds the specified threshold.
Rolling Average
Define this value as the maximum acceptable average response time over a specified number of calls. The API monitoring service keeps a record of how many times this threshold is breached. From a dropdown menu, users can select to calculate the average from the last 10, 15, 20, 25, or 30 calls. If the radio button is set to 'Yes,' the system will send an email notification to the user when the rolling average exceeds the defined threshold. Users will receive one alert when the threshold is surpassed and another alert when the average falls back below the threshold.
Expected Status Code
This is the anticipated value that the user is looking to receive from the API call. The user will be notified by email whenever the status code deviates from the expected value or when it returns to the expected value. When the API call is returning the expected status code, a thumbs-up icon will be displayed to indicate that the API call is functioning as intended.
____
### 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.
You will be provided with the list of authorization options like:
You can choose None if the API does not require any authorization, or you can select one of the supported authorization methods from the dropdown menu displayed.
Basic Authentication (Basic Auth) is a method of securing web resources by transmitting a username and password with each HTTP request.
You can now provide username and password for the API.
OAuth 2.0 is an industry-standard protocol for authorization, allowing secure access to resources on behalf of a user or application without sharing the users credentials.
You can now provide access token for the API.
Headers in an API are metadata or key-value pairs included in the HTTP request to provide additional information or instructions for the server.
To generate Test Scripts from swagger URL, select Importing APIs from a Swagger JSON URL option as shown below.
Now provide swagger URL and click on Get APIs
For example, https://petstore.swagger.io/v2/swagger.json.
Now you will be listed with APIs as shown below.
Now select the APIs that you would wish to import and click on Create Monitored APIs button.
On successfully importing the API and creating the Test Script you will be able to see the script created as shown below.
To generate Test Scripts from swagger URL, select Importing APIs from a Swagger JSON File option as shown below.
Now you will be listed with APIs as shown below.
Now select the APIs that you would wish to import and click on Create Monitored APIs button.
On successfully importing the API and creating the Test Script you will be able to see the script created as shown below.
To generate Test Scripts from Postman Collection URL, select Importing from a Postman Collection URL option as shown below.
Now provide swagger URL and click on Get APIs
Now you will be listed with APIs as shown below.
Now select the APIs that you would wish to import and click on Create Monitored APIs button.
On successfully importing the API and creating the Test Script you will be able to see the script created as shown below.
To generate Test Scripts from Postman Collection URL, select Importing from a Postman Collection File option as shown below.
Now you will be listed with APIs as shown below.
Now select the APIs that you would wish to import and click on Create Monitored APIs button.
On successfully importing the API and creating the Test Script you will be able to see the script created as shown below.
NOTE: It's important to keep in mind that if your API was in monitoring mode when you updated its information, the monitoring process will be temporarily halted to incorporate the changes.
To clone the Test Script, click on the Clone API icon as shown below.
Once the script is cloned you should be able to view the clonned script in the Test Scripts list.
If you want to delete any of your Test Script, Hover on the desired Test Script and click on Delete icon.
You will receive a confirmation prompt for test script deletion. If you still wish to delete the test script, click Yes; otherwise, click No.
When you successfully delete the test script, you will receive a confirmation message saying API deleted successfully!.
You can provide the API header in a key-value format.
To modify the details of a manually created or imported API, simply click the Edit button, make your desired changes, and then click the Save icon.