API Actions
Qualitia Automation Studio contains the following actions to execute API services.
REST.Request.RemoveGenericHeaders
REST.Request.ResetGenericHeaders
REST.Request.SetHeaders
REST.Request.SetQueryParameters
REST.Request.ClearQueryParameters
REST.Auth.Basic
REST.Auth.Digest
REST.Auth.Bearer
REST.Auth.JWT
REST.Request.SetTimeout
REST.Request.WaitForAttribute
REST.Request.SetFormUrlEncodedParameters
REST.Request.ImportSSLCertificate
REST.GET.ExecuteAPI
REST.POST.ExecuteAPI
REST.PUT.ExecuteAPI
REST.PATCH.ExecuteAPI
REST.DELETE.ExecuteAPI
REST.GET.ExecuteAPIFormData
REST.POST.ExecuteAPIFormData
REST.PUT.ExecuteAPIFormData
REST.DELETE.ExecuteAPIFormData
REST.GET.ExecuteAPIDownloadRawData
REST.PUT.ExecuteAPIDownloadRawData
REST.POST.ExecuteAPIDownloadRawData
REST.DELETE.ExecuteAPIDownloadRawData
REST.Response.StoreStatusCode
REST.Response.StoreHeaders
REST.Response.StoreHeaderValue
REST.Response.VerifyStatusCode
REST.Response.VerifyHeaders
REST.Response.StoreResponseTime
REST.Response.CompareResponseTime
REST.ExecuteService (Deprecated)
REST.ExecuteAPIService (Deprecated)
SOAP.ExecuteService
Info |
---|
Before executing Rest API services, ensure that you configure the header parameters in the Rest Generic Headers tab of Project Settings. To execute Rest API services through the offline suite, you need to open the Qualitia Offline Configuration Manager and add or edit the values in RestGenericHeaders tab. For information about setting these parameters for executing test cases using Qualitia offline package, refer to the Configuring the Settings for an OfflineSuite. |
...
This action helps you skip the generic headers you set in the Rest Generic Headers tab of Project Settings.
Input Parameters:
Parameter Name | Parameter Description | Mandatory | Data Types |
---|---|---|---|
HeaderKey | Enter the header key which you want to skip defined in the Rest Generic Headers Settings. | Yes | String |
...
Headers set using this action will override the headers set in the Rest Generic Headers tab.
Input Parameters:
Parameter Name | Parameter Description | Mandatory | Data Types |
---|---|---|---|
HeaderLabel | Enter the variable name under which you want to store the key=value pair of the header. | Yes | String |
HeaderKey | Enter the header key which you want to set for the API service to be executed. | Yes | String |
HeaderValue | Enter the value for the key set above. | Yes | String |
...
REST.Request.SetHeaders "H1" "If-Match" "a8f34"
REST.Request.SetHeaders "H2" "accept" "application/xml"
...
You may set multiple query parameters using test data. This action must be used before executing API service.
Input Parameters:
Parameter Name | Parameter Description | Mandatory | Data Types |
---|---|---|---|
QueryKey | Enter the key which you want to set for the API service to be executed. | Yes | String |
QueryValue | Enter the value for the key set above. | Yes | String |
...
This action helps you set the basic authentication details for the API service you want to execute. Authentication details you provide here are applicable for the entire session of the test case or test suite.
Input Parameters:
Parameter Name | Parameter Description | Mandatory | Data Types |
---|---|---|---|
Username | Enter the username for authentication. | Yes | String |
Password | Enter the password for authentication. Password should be given in the specific format to be encrypted. Format: Encrypt(<PASSWORD>) | Yes | String |
Example:
REST.Auth.Basic "Qualitia" "Encrypt(Qualitia123)"
When the focus is moved away from the parameter, Qualitia will automatically encrypt the data ABC and result in a secured text like "vHpmlfI4R3PQkCN4sZnuqw==þNWE3ZDdkNjE3N2JmNDM2ODgxMzQwYWI1MTA3YWNjMDc="
...
This action helps you set the digest authentication details for the API service you want to execute. Authentication details you provide here are applicable for the entire session of the test case or test suite.
Input Parameters:
Parameter Name | Parameter Description | Mandatory | Data Types |
---|---|---|---|
Username | Enter the username for authentication. | Yes | String |
Password | Enter the password for authentication. Password should be given in the specific format to be encrypted. Format: Encrypt(<PASSWORD>) | Yes | String |
Example:
REST.Auth.Digest "Qualitia" "Encrypt(Qualitia123)"
When the focus is moved away from the parameter, Qualitia will automatically encrypt the data ABC and result in a secured text like "vHpmlfI4R3PQkCN4sZnuqw==þNWE3ZDdkNjE3N2JmNDM2ODgxMzQwYWI1MTA3YWNjMDc="
...
This action helps you set the bearer authentication details for the API service you want to execute. Authentication details you provide here are applicable for the entire session of the test case or test suite.
Input Parameters:
Parameter Name | Parameter Description | Mandatory | Data Types |
---|---|---|---|
Token | Enter the token to access API service you want to execute. | Yes | String |
...
This action helps you set the jwt authentication details for the API service you want to execute. Authentication details you provide here are applicable for the entire session of the test case or test suite.
Input Parameters:
Parameter Name | Parameter Description | Mandatory | Data Types |
---|---|---|---|
Token | Enter the token to access API service you want to execute. | Yes | String |
...
REST.Request.WaitForAttribute “$.address.postalCode” "" "20" "seconds"
XML:
REST.Request.WaitForAttribute “//actors/actor[@id='1']” "" "20" "seconds"
REST.Request.SetFormUrlEncodedParameters
This action helps you to add the request body data as key value pair in the form of URL encoded format. Qualitia converts the given data into the URL encoded form data. You can give multiple pairs using the test data. In order to use this action to add form data while executing any API service action, you must use this action prior to API service.
...
Parameter Name | Parameter Description | Mandatory | Data Type |
---|---|---|---|
key | Enter the key name. | Yes | String |
Value | Enter the value for the key mentioned above. | Yes | String |
Example:
REST.Request.SetFormUrlEncodedParameters "id" "23950329"
REST.Request.ImportSSLCertificate
...
This action supports XML or JSON application file types.
You can also store the information related to HTTP Status, HTTP REQUEST TIME, and Header into the variable and use these values to develop test case flow after executing this action.
Input Parameters:
Parameter Name | Parameter Description | Mandatory | Data Types |
---|---|---|---|
BaseURL | Enter the URL where you want to execute the API service. | Yes | String |
BasePath | Enter the base path where you want to execute API service. You can include path in the BaseURL parameter itself. In that case, you may keep this parameter blank. | No | String |
AuthenticationType | Enter authentication type you want to use while executing the API service. Values for this field can be either: Basic, Bearer, JWT, or Digest. Keeping this field blank will be taken as no authentication. For Basic, Bearer, JWT, and Digest authentication types, details will be taken from the previous steps where details are provided. | No | String |
HeaderLabel | Enter the header label in case you have specified it earlier in the test case. | No | String |
SSLFlag | Using this parameter, you can decide whether you want to consider SSL certificate while executing the API service.
External certificate files are not supported. | No | String |
ResponseFilepath | Enter the absolute path to the file where you want to store the response you get after the service is executed. File types supported are XML, HTML, TXT, and JSON. | Yes | String |
ExpectedHTTPStatusCode | You can give the http status code that you expect at the end of the API service execution. From all the available forty different status code, you can provide any value that you expect. In case you are not sure about the exact expected value, you can also give the category of http status code. For example, 1xx, 2xx, and so forth. Multiple codes or code ranges can be given separated by comma (,). | No | String |
...
REST.GET.ExecuteAPI “https://<HOST_NAME>:<PORT_NUMBER>/<REST_URL>” "ProjectMapping/OAT" "Basic" "" "False" "C:\Users\Qualitia\Request-Cust_List.xml" "200"
REST.GET.ExecuteAPI “https://<HOST_NAME>:<PORT_NUMBER>/<REST_URL>” "ProjectMapping/OAT" "Basic" "HeaderLebel" "False" "C:\Users\Qualitia\Request-Cust_List.json" "4xx"
REST.POST.ExecuteAPI
This action helps to add the desired data using POST method while executing the API service.
...
This action supports XML or JSON application file types.
You can also store the information related to HTTP Status, HTTP REQUEST TIME, and Header into the variable and use these values to develop test case flow after executing this action.
Input Parameters:
Parameter Name | Parameter Description | Mandatory | Data Types |
---|---|---|---|
BaseURL | Enter the URL where you want to execute the API service. | Yes | String |
BasePath | Enter the base path where you want to execute API service. You can include path in the BaseURL parameter itself. In that case, you may keep this parameter blank. | Optional | String |
RequestFilepath | Enter the absolute path to the file from which you want to post the data. File types supported are XML, HTML, TXT, and JSON. | Optional | String |
AuthenticationType | Enter authentication type you want to use while executing the API service. Values for this field can be either: Basic, Bearer, JWT, or Digest. Keeping this field blank will be taken as no authentication. For Basic, Bearer, JWT, and Digest authentication types, details will be taken from the previous steps where details are provided. | Optional | String |
HeaderLabel | Enter the header label in case you have specified it earlier in the test case/task. | Optional | String |
SSLFlag | Using this parameter, you can decide whether you want to consider SSL certificate while executing the API service.
External certificate files are not supported. | Optional | String |
ResponseFilepath | Enter the absolute path to the file where you want to store the response you get after the service is executed. File types supported are XML, HTML, TXT, and JSON. | Yes | String |
ExpectedHTTPStatusCode | You can give the http status code that you expect at the end of the API service execution. From all the available forty different status code, you can provide any value that you expect. In case you are not sure about the exact expected value, you can also give the category of http status code. For example, 1xx, 2xx, and so forth. Multiple codes or code ranges can be given separated by comma (,). | Optional | String |
Info |
---|
Important Notes:If the response file extension is XML and response is in JSON, the system converts XML response into JSON and vice versa. To store HTML responses, ReponseFilePath should contain file path to .html file. In case the response file extension is not matching with the file format provided by the API, the system stores the response in the file without extension. You can open such files with the help of any text editor like Notepad. |
Example:
REST.POST.ExecuteAPI “https://<HOST_NAME>:<PORT_NUMBER>/<REST_URL>” "ProjectMapping/OAT" "Basic" "" "False" "C:\Users\Qualitia\Request-Cust_List.xml" "2xx,3xx"
REST.POST.ExecuteAPI “https://<HOST_NAME>:<PORT_NUMBER>/<REST_URL>” "ProjectMapping/OAT" "Basic" "HeaderLebel" "False" "C:\Users\Qualitia\Request-Cust_List.json" "200,300"
REST.PUT.ExecuteAPI
This action helps to update the desired data using PUT method while executing the API service.
...
This action supports XML or JSON application file types.
You can also store the information related to HTTP Status, HTTP REQUEST TIME, and Header into the variable and use these values to develop test case flow after executing this action.
Input Parameters:
Parameter Name | Parameter Description | Mandatory | Data Types |
---|---|---|---|
BaseURL | Enter the URL where you want to execute the API service. | Yes | String |
BasePath | Enter the base path where you want to execute API service. You can include path in the BaseURL parameter itself. In that case, you may keep this parameter blank. | No | String |
RequestFilepath | Enter the absolute path to the file from which you want to post the data. File types supported are XML, HTML, TXT, and JSON. | No | String |
AuthenticationType | Enter authentication type you want to use while executing the API service. Values for this field can be either: Basic, Bearer, JWT, or Digest. Keeping this field blank will be taken as no authentication. For Basic, Bearer, JWT, and Digest authentication types, details will be taken from the previous steps where details are provided. | No | String |
HeaderLabel | Enter the header label in case you have specified it earlier in the test case/task. | No | String |
SSLFlag | Using this parameter, you can decide whether you want to consider SSL certificate while executing the API service.
| No | String |
ResponseFilepath | Enter the absolute path to the file where you want to store the response you get after the service is executed. File types supported are XML, HTML, TXT, and JSON. | Yes | String |
ExpectedHTTPStatusCode | You can give the http status code that you expect at the end of the API service execution. From all the available forty different status code, you can provide any value that you expect. In case you are not sure about the exact expected value, you can also give the category of http status code. For example, 1xx, 2xx, and so forth. Multiple codes or code ranges can be given separated by comma (,). | No | String |
Info |
---|
Important Notes:If the response file extension is XML and response is in JSON, the system converts XML response into JSON and vice versa. To store HTML responses, ReponseFilePath should contain file path to .html file. In case the response file extension is not matching with the file format provided by the API, the system stores the response in the file without extension. You can open such files with the help of any text editor like Notepad. |
Example:
REST.PUT.ExecuteAPI “https://<HOST_NAME>:<PORT_NUMBER>/<REST_URL>” "ProjectMapping/OAT" "Basic" "" "False" "C:\Users\Qualitia\Request-Cust_List.xml" "400"
REST.PUT.ExecuteAPI “https://<HOST_NAME>:<PORT_NUMBER>/<REST_URL>” "ProjectMapping/OAT" "Basic" "HeaderLebel" "False" "C:\Users\Qualitia\Request-Cust_List.json" "2xx,400"
REST.PATCH.ExecuteAPI
Info |
---|
This action is supported on Qualitia Automation Studio v8.0.2 and above. |
...
This action supports XML or JSON application file types.
You can also store the information related to HTTP Status, HTTP REQUEST TIME, and Header into the variable and use these values to develop test case flow after executing this action.
Input Parameters:
Parameter Name | Parameter Description | Mandatory | Data Types |
---|---|---|---|
BaseURL | Enter the URL where you want to execute the API service. | Yes | String |
BasePath | Enter the base path where you want to execute API service. You can include path in the BaseURL parameter itself. In that case, you may keep this parameter blank. | No | String |
RequestFilepath | Enter the absolute path to the file from which you want to post the data. File types supported are XML, HTML, TXT, and JSON. | No | String |
AuthenticationType | Enter authentication type you want to use while executing the API service. Values for this field can be either: Basic, Bearer, JWT, or Digest. Keeping this field blank will be taken as no authentication. For Basic, Bearer, JWT, and Digest authentication types, details will be taken from the previous steps where details are provided. | No | String |
HeaderLabel | Enter the header label in case you have specified it earlier in the test case/task. | No | String |
SSLFlag | Using this parameter, you can decide whether you want to consider SSL certificate while executing the API service.
External certificate files are not supported. | No | String |
ResponseFilepath | Enter the absolute path to the file where you want to store the response you get after the service is executed. File types supported are XML, HTML, TXT, and JSON. | Yes | String |
ExpectedHTTPStatusCode | You can give the http status code that you expect at the end of the API service execution. From all the available forty different status code, you can provide any value that you expect. In case you are not sure about the exact expected value, you can also give the category of http status code. For example, 1xx, 2xx, and so forth. Multiple codes or code ranges can be given separated by comma (,). | No | String |
...
REST.DELETE.ExecuteAPI “https://<HOST_NAME>:<PORT_NUMBER>/<REST_URL>” "ProjectMapping/OAT" "Basic" "" "False" "C:\Users\Qualitia\Request-Cust_List.xml" "300"
REST.DELETE.ExecuteAPI “https://<HOST_NAME>:<PORT_NUMBER>/<REST_URL>” "ProjectMapping/OAT" "Basic" "HeaderLebel" "False" "C:\Users\Qualitia\Request-Cust_List.json" "500,2xx"
REST.GET.ExecuteAPIFormData
This action helps to pull the desired information using GET method while executing the API service with the help of form-data. The form-data can contain one or multiple sets of key-value pairs which will eventually help in executing the specified request method.
This action can work independently or it can be used in a combination of other REST actions like REST.Request.SetGenericHeaders, REST.Request.SetHeaders, REST.Request.SetQueryParameters, REST.Auth.Basic/Digest/Bearer/JWT, based on the test case requirements.
You can also store the information related to HTTP Status, HTTP REQUEST TIME, and Header into the variable and use these values to develop test case flow after executing this action.
Input Parameters:
Parameter Name | Parameter Description | Mandatory | Data Types |
---|---|---|---|
BaseURL | Enter the URL where you want to execute the API service. | Yes | String |
BasePath | Enter the base path where you want to execute API service. You can include path in the BaseURL parameter itself. In that case, you may keep this parameter blank. | No | String |
AuthenticationType | Enter authentication type you want to use while executing the API service. Values for this field can be either: Basic, Bearer, JWT, or Digest. Keeping this field blank will be taken as no authentication. For Basic, Bearer, JWT, and Digest authentication types, details will be taken from the previous steps where details are provided. | No | String |
HeaderLabel | Enter the header label in case you have specified it earlier in the test case/task. | No | String |
SSLFlag | Using this parameter, you can decide whether you want to consider SSL certificate while executing the API service.
External certificate files are not supported. | No | String |
ResponseFilepath | Enter the absolute path to the file where you want to store the response you get after the service is executed. | Yes | String |
ExpectedHTTPStatusCode | You can give the http status code that you expect at the end of the API service execution. From all the available forty different status code, you can provide any value that you expect. In case you are not sure about the exact expected value, you can also give the category of http status code. For example, 1xx, 2xx, and so forth. Multiple codes or code ranges can be given separated by comma (,). | No | String |
...
REST.GET.ExecuteAPIFormData “https://<HOST_NAME>:<PORT_NUMBER>/<REST_URL>” "ProjectMapping/OAT” “Bearer” "HeaderLabel1” "True" “C:\Users\Qualitia\Reponse-Cust_List.json” "3xx"
REST.POST.ExecuteAPIFormData
This action helps to add desired information using POST method while executing the API service with the help of form-data. The form-data can contain one or multiple sets of key-value pairs which will eventually help in executing the specified request method.
This action can work independently or it can be used in a combination of other REST actions like REST.Request.SetGenericHeaders, REST.Request.SetHeaders, REST.Request.SetQueryParameters, REST.Auth.Basic/Digest/Bearer/JWT, based on the test case requirements.
You can also store the information related to HTTP Status, HTTP REQUEST TIME, and Header into the variable and use these values to develop test case flow after executing this action.
Input Parameters:
Parameter Name | Parameter Description | Mandatory | Data Types |
---|---|---|---|
BaseURL | Enter the URL where you want to execute the API service. | Yes | String |
BasePath | Enter the base path where you want to execute API service. You can include path in the BaseURL parameter itself. In that case, you may keep this parameter blank. | No | String |
FormData | Enter the key value pairs of the form data to be used while executing the service. Multiple pairs should be separated by a caret sign (^). If you want to use file to provide form data, add all the form data in some file and provide absolute path to that file as a parameter. Data in the file should be well formatted. | No | Array |
AuthenticationType | Enter authentication type you want to use while executing the API service. Values for this field can be either: Basic, Bearer, JWT or Digest. Keeping this field blank will be taken as no authentication. For Basic, Bearer, JWT, and Digest authentication types, details will be taken from the previous steps where details are provided. | No | String |
HeaderLabel | Enter the header label in case you have specified it earlier in the test case/task. | No | String |
SSLFlag | Using this parameter, you can decide whether you want to consider SSL certificate while executing the API service.
External certificate files are not supported. | No | String |
ResponseFilepath | Enter the absolute path to the file where you want to store the response you get after the service is executed. | Yes | String |
ExpectedHTTPStatusCode | You can give the http status code that you expect at the end of the API service execution. From all the available forty different status code, you can provide any value that you expect. In case you are not sure about the exact expected value, you can also give the category of http status code. For example, 1xx, 2xx, and so forth. Multiple codes or code ranges can be given separated by comma (,). | Optional | String |
...
REST.POST.ExecuteAPIFormData “https://<HOST_NAME>:<PORT_NUMBER>/<REST_URL>” "ProjectMapping/OAT” "Filefile=C:\Users\Qualitia\Request-Cust_List.json" “Bearer” "HeaderLabel1” "True" “C:\Users\Qualitia\Reponse-Cust_List.json” "3xx"
REST.PUT.ExecuteAPIFormData
This action helps to update desired information using PUT method while executing the API service with the help of form-data. The form-data can contain one or multiple sets of key-value pairs which will eventually help in executing the specified request method.
This action can work independently or it can be used in a combination of other REST actions like REST.Request.SetGenericHeaders, REST.Request.SetHeaders, REST.Request.SetQueryParameters, REST.Auth.Basic/Digest/Bearer/JWT, based on the test case requirements.
You can also store the information related to HTTP Status, HTTP REQUEST TIME, and Header into the variable and use these values to develop test case flow after executing this action.
Input Parameters:
Parameter Name | Parameter Description | Mandatory | Data Types |
---|---|---|---|
BaseURL | Enter the base URL where you want to execute the API service. | Yes | String |
BasePath | Enter the base path where you want to execute API service. You can include path in the BaseURL parameter itself. In that case, you may keep this parameter blank. | No | String |
FormData | Enter the key value pairs of the form data to be used while executing the service. Multiple pairs should be separated by a caret sign (^). If you want to use file to provide form data, add all the form data in some file and provide absolute path to that file as a parameter. Data in the file should be well formatted. | No | Array |
AuthenticationType | Enter authentication type you want to use while executing the API service. Values for this field can be either: Basic, Bearer, JWT or Digest. Keeping this field blank will be taken as no authentication. For Basic, Bearer, JWT, and Digest authentication types, details will be taken from the previous steps where details are provided. | No | String |
HeaderLabel | Enter the header label in case you have specified it earlier in the test case/task. | No | String |
SSLFlag | Using this parameter, you can decide whether you want to consider SSL certificate while executing the API service.
External certificate files are not supported. | No | String |
ResponseFilepath | Enter the absolute path to the file where you want to store the response you get after the service is executed. | Yes | String |
ExpectedHTTPStatusCode | You can give the http status code that you expect at the end of the API service execution. From all the available forty different status code, you can provide any value that you expect. In case you are not sure about the exact expected value, you can also give the category of http status code. For example, 1xx, 2xx, and so forth. Multiple codes or code ranges can be given separated by comma (,). | No | String |
...
REST.PUT.ExecuteAPIFormData “https://<HOST_NAME>:<PORT_NUMBER>/<REST_URL>” "ProjectMapping/OAT” "Filefile=C:\Users\Qualitia\Request-Cust_List.json" “Bearer” "HeaderLabel1” "True" “C:\Users\Qualitia\Reponse-Cust_List.json” "3xx"
REST.DELETE.ExecuteAPIFormData
This action helps to remove desired information using DELETE method while executing the API service with the help of form-data. The form-data can contain one or multiple sets of key-value pairs which will eventually help in executing the specified request method.
This action can work independently or it can be used in a combination of other REST actions like REST.Request.SetGenericHeaders, REST.Request.SetHeaders, REST.Request.SetQueryParameters, REST.Auth.Basic/Digest/Bearer/JWT, based on the test case requirements.
You can also store the information related to HTTP Status, HTTP REQUEST TIME, and Header into the variable and use these values to develop test case flow after executing this action.
Input Parameters:
Parameter Name | Parameter Description | Mandatory | Data Types |
---|---|---|---|
BaseURL | Enter the base URL where you want to execute the API service. | Yes | String |
BasePath | Enter the base path where you want to execute API service. You can include path in the BaseURL parameter itself. In that case, you may keep this parameter blank. | No | String |
FormData | Enter the key value pairs of the form data to be used while executing the service. Multiple pairs should be separated by a caret sign (^). If you want to use file to provide form data, add all the form data in some file and provide absolute path to that file as a parameter. Data in the file should be well formatted. | No | Array |
AuthenticationType | Enter authentication type you want to use while executing the API service. Values for this field can be either: Basic, Bearer, JWT, or Digest. Keeping this field blank will be taken as no authentication. For Basic, Bearer, JWT, and Digest authentication types, details will be taken from the previous steps where details are provided. | No | String |
HeaderLabel | Enter the header label in case you have specified it earlier in the test case/task. | No | String |
SSLFlag | Using this parameter, you can decide whether you want to consider SSL certificate while executing the API service.
External certificate files are not supported. | No | String |
ResponseFilepath | Enter the absolute path to the file where you want to store the response you get after the service is executed. | Yes | String |
ExpectedHTTPStatusCode | You can give the http status code that you expect at the end of the API service execution. From all the available forty different status code, you can provide any value that you expect. In case you are not sure about the exact expected value, you can also give the category of http status code. For example, 1xx, 2xx, and so forth. Multiple codes or code ranges can be given separated by comma (,). | No | String |
...
REST.DELETE.ExecuteAPIFormData “https://<HOST_NAME>:<PORT_NUMBER>/<REST_URL>” "ProjectMapping/OAT” "Filefile=C:\Users\Qualitia\Request-Cust_List.json" “Bearer” "HeaderLabel1” "True" “C:\Users\Qualitia\Reponse-Cust_List.json” "400"
REST.GET.ExecuteAPIDownloadRawData
This action helps to pull the desired information using GET method. You can download raw data file after executing the action giving the desired download location.
This action can work independently or it can be used in a combination of other REST actions like REST.Request.SetGenericHeaders, REST.Request.SetHeaders, REST.Request.SetQueryParameters, REST.Auth.Basic/Digest/Bearer/JWT, based on the test case requirements.
You can also store the information related to HTTP Status, HTTP REQUEST TIME, and Header into the variable and use these values to develop test case flow after executing this action.
Input Parameters:
Parameter Name | Parameter Description | Mandatory | Data Types |
---|---|---|---|
BaseURL | Enter the URL where you want to execute the API service. | Yes | String |
BasePath | Enter the base path where you want to execute API service. You can include path in the BaseURL parameter itself. In that case, you may keep this parameter blank. | No | String |
AuthenticationType | Enter authentication type you want to use while executing the API service. Values for this field can be either: Basic, Bearer, JWT or Digest. Keeping this field blank will be taken as no authentication. For Basic, Bearer, JWT, and Digest authentication types, details will be taken from the previous steps where details are provided. | No | String |
HeaderLabel | Enter the header label in case you have specified it earlier in the test case/task. | No | String |
SSLFlag | Using this parameter, you can decide whether you want to consider SSL certificate while executing the API service.
External certificate files are not supported. | No | String |
ResponseFilepath | Enter the absolute path to the file where you want to store the response you get after the service is executed. | Yes | String |
DownloadLocation | Enter the folder directory location where you want to store the raw data after executing the test case. | No | String |
| You can give the http status code that you expect at the end of the API service execution. From all the available forty different status code, you can provide any value that you expect. In case you are not sure about the exact expected value, you can also give the category of http status code. For example, 1xx, 2xx, and so forth. Multiple codes or code ranges can be given separated by comma (,). | No | String |
...
REST.GET.ExecuteAPIDownloadRawData “https://<HOST_NAME>:<PORT_NUMBER>/<REST_URL>” "ProjectMapping/OAT” “Bearer” "HeaderLabel1” "True" “C:\Users\Qualitia\Reponse-Cust_List.json” "D:\New Folder\RawDataFiles" "300"
REST.PUT.ExecuteAPIDownloadRawData
This action helps to update desired information using PUT method. It uses raw data while executing API service. You can download raw data file after executing the action giving desired download location.
This action can work independently or it can be used in a combination of other REST actions like REST.Request.SetGenericHeaders, REST.Request.SetHeaders, REST.Request.SetQueryParameters, REST.Auth.Basic/Digest/Bearer/JWT, based on the test case requirements.
You can also store the information related to HTTP Status, HTTP REQUEST TIME, and Header into the variable and use these values to develop test case flow after executing this action.
Input Parameters:
Parameter Name | Parameter Description | Mandatory | Data Types |
---|---|---|---|
BaseURL | Enter the URL where you want to execute the API service. | Yes | String |
BasePath | Enter the base path where you want to execute API service. You can include path in the BaseURL parameter itself. In that case, you may keep this parameter blank. | No | String |
RequestFilepath | Enter the absolute path to the file which has REST request-related information. In this file, you can specify the details which you want to update. | No | |
AuthenticationType | Enter authentication type you want to use while executing the API service. Values for this field can be either: Basic, Bearer, JWT, or Digest. Keeping this field blank will be taken as no authentication. For Basic, Bearer, JWT, and Digest authentication types, details will be taken from the previous steps where details are provided. | No | String |
HeaderLabel | Enter the header label in case you have specified it earlier in the test case/task. | No | String |
SSLFlag | Using this parameter, you can decide whether you want to consider SSL certificate while executing the API service.
| No | String |
ResponseFilepath | Enter the absolute path to the file where you want to store the response you get after the service is executed. | Yes | String |
DownloadLocation | Enter the folder directory location where you want to store the raw data after executing the test case. | No | String |
ExpectedHTTPStatusCode | You can give the http status code that you expect at the end of the API service execution. From all the available forty different status code, you can provide any value that you expect. In case you are not sure about the exact expected value, you can also give the category of http status code. For example, 1xx, 2xx, and so forth. Multiple codes or code ranges can be given separated by comma (,). | No | String |
...
REST.PUT.ExecuteAPIDownloadRawData “https://<HOST_NAME>:<PORT_NUMBER>/<REST_URL>” "ProjectMapping/OAT” “C:\Users\Qualitia\Request-Cust_List.json” “Bearer” "HeaderLabel1” "True" “C:\Users\Qualitia\Reponse-Cust_List.json” "D:\New Folder\RawDataFiles" "300"
REST.POST.ExecuteAPIDownloadRawData
This action helps to add desired information using POST method. It uses raw data while executing API service. You can download raw data file after executing the action giving desired download location.
This action can work independently or it can be used in a combination of other REST actions like REST.Request.SetGenericHeaders, REST.Request.SetHeaders, REST.Request.SetQueryParameters, REST.Auth.Basic/Digest/Bearer/JWT, based on the test case requirements.
You can also store the information related to HTTP Status, HTTP REQUEST TIME, and Header into the variable and use these values to develop test case flow after executing this action.
Input Parameters:
Parameter Name | Parameter Description | Mandatory | Data Types |
---|---|---|---|
BaseURL | Enter the URL where you want to execute the API service. | Yes | String |
BasePath | Enter the base path where you want to execute API service. You can include path in the BaseURL parameter itself. In that case, you may keep this parameter blank. | Optional | String |
RequestFilepath | Enter the absolute path to the file which has REST request-related information. In this file, you can specify the details which you want to add. | ||
AuthenticationType | Enter authentication type you want to use while executing the API service. Values for this field can be either: Basic, Bearer, JWT, or Digest. Keeping this field blank will be taken as no authentication. For Basic, Bearer, JWT, and Digest authentication types, details will be taken from the previous steps where details are provided. | Optional | String |
HeaderLabel | Enter the header label in case you have specified it earlier in the test case/task. | Optional | String |
SSLFlag | Using this parameter, you can decide whether you want to consider SSL certificate while executing the API service.
External certificate files are not supported. | Optional | String |
ResponseFilepath | Enter the absolute path to the file where you want to store the response you get after the service is executed. | Yes | String |
DownloadLocation | Enter the folder directory location where you want to store the raw data after executing the test case. | Yes | String |
ExpectedHTTPStatusCode | You can give the http status code that you expect at the end of the API service execution. From all the available forty different status code, you can provide any value that you expect. In case you are not sure about the exact expected value, you can also give the category of http status code. For example, 1xx, 2xx, and so forth. Multiple codes or code ranges can be given separated by comma (,). | Optional | String |
...
REST.POST.ExecuteAPIDownloadRawData “https://<HOST_NAME>:<PORT_NUMBER>/<REST_URL>” "ProjectMapping/OAT” “C:\Users\Qualitia\Request-Cust_List.json” “Bearer” "HeaderLabel1” "True" “C:\Users\Qualitia\Reponse-Cust_List.json” "D:\New Folder\RawDataFiles" "300"
REST.DELETE.ExecuteAPIDownloadRawData
This action helps to delete desired information using DELETE method. It uses raw data while executing API service. You can download raw data file after executing the action giving desired download location.
This action can work independently or it can be used in a combination of other REST actions like REST.Request.SetGenericHeaders, REST.Request.SetHeaders, REST.Request.SetQueryParameters, REST.Auth.Basic/Digest/Bearer/JWT, based on the test case requirements.
You can also store the information related to HTTP Status, HTTP REQUEST TIME, and Header into the variable and use these values to develop test case flow after executing this action.
Input Parameters:
Parameter Name | Parameter Description | Mandatory | Data Types |
---|---|---|---|
BaseURL | Enter the URL where you want to execute the API service. | Yes | String |
BasePath | Enter the base path where you want to execute API service. You can include path in the BaseURL parameter itself. In that case, you may keep this parameter blank. | Optional | String |
RequestFilepath | Enter the absolute path to the file which has REST request-related information. In this file, you can specify the details which you want to DELETE. | ||
AuthenticationType | Enter authentication type you want to use while executing the API service. Values for this field can be either: Basic, Bearer, JWT, or Digest. Keeping this field blank will be taken as no authentication. For Basic, Bearer, JWT, and Digest authentication types, details will be taken from the previous steps where details are provided. | Optional | String |
HeaderLabel | Enter the header label in case you have specified it earlier in the test case/task. | Optional | String |
SSLFlag | Using this parameter, you can decide whether you want to consider SSL certificate while executing the API service.
External certificate files are not supported. | Optional | String |
ResponseFilepath | Enter the absolute path to the file where you want to store the response you get after the service is executed. | Yes | String |
DownloadLocation | Enter the folder directory location where you want to store the raw data after executing the test case. | Yes | String |
ExpectedHTTPStatusCode | You can give the http status code that you expect at the end of the API service execution. From all the available forty different status code, you can provide any value that you expect. In case you are not sure about the exact expected value, you can also give the category of http status code. For example, 1xx, 2xx, and so forth. Multiple codes or code ranges can be given separated by comma (,). | Optional | String |
...
REST.DELETE.ExecuteAPIDownloadRawData “https://<HOST_NAME>:<PORT_NUMBER>/<REST_URL>” "ProjectMapping/OAT” “C:\Users\Qualitia\Request-Cust_List.json” “Bearer” "HeaderLabel1” "True" “C:\Users\Qualitia\Reponse-Cust_List.json” "D:\New Folder\RawDataFiles" "300"
REST.Response.StoreStatusCode
...
This action has to be used immediately followed by the API service action.
Input Parameters:
Parameter Name | Parameter Description | Mandatory | Data Types |
---|---|---|---|
key | Enter the variable name under which you want to store the status code of the API service executed. | Yes | String |
...
This action has to be used immediately followed by the API service action.
Input Parameters:
Parameter Name | Parameter Description | Mandatory | Data Types |
---|---|---|---|
key | Enter the variable name under which you want to store the header data of the API service executed. | Yes | String |
...
This action stores the specified header value from the response given by API service under the specified key. You can then use the stored value based on your test case requirements.
Input Parameters:
Parameter Name | Parameter Description | Mandatory | Data Types |
---|---|---|---|
key | Enter the variable name under which you want to store the header value of the specified key. | Yes | String |
HeaderKey | Enter the header key whose value you want to store from the response header. | Yes | String |
...
This action verifies the status of the API service executed against the status specified by the user. This helps in deciding the test case or test suite flow based on the API service status.
Input Parameters:
Parameter Name | Parameter Description | Mandatory | Data Types |
---|---|---|---|
Key | This is the variable name under which the status is stored using the REST.StoreStatusCode action. | Yes | String |
ExpectedStatus | Enter the expected status here to verify against the actual status of the API service executed. | Yes | String |
...
You can give multiple sets of key and value pairs using test data.
Input Parameters:
Parameter Name | Parameter Description | Mandatory | Data Types |
---|---|---|---|
Key | This takes key-value pair . Example: Content-Type=text/html | Yes | String |
HeaderKey | This is the key from key-value pair that is provided in 1st parameter. Example: Content-Type | Yes | String |
HeaderValue | This is the value from key-value pair that is provided in 1st parameter. Example: text/html | Yes | String |
...
Qualitia Automation Studio contains the following actions to perform operations on JSON files.
JSON.AddNode
JSON.RemoveNode
JSON.ConvertStringToFile
JSON.ValidateStringSynta
JSON.StoreArray
JSON.StoreAllUniqueKey
JSON.StoreTotalKeyCount
JSON.StoreSpecificKeyCount
JSON.StoreValue
JSON.StoreJsonPathCount
JSON.CompareJson
JSON.UpdateValueFromJson
JSON.UpdateValueInJson (Deprecated)
Also, you can use ValidateStringSyntaxinFile to validates the syntax of XML or JSON file.
...
If you want to add multiple values under the key, you must give values in the correct format accordingly.
Input Parameters:
Parameter Name | Parameter Description | Mandatory | Data Types |
---|---|---|---|
FilePath | Enter the absolute file path to the JSON file where you want to add the node. | Yes | String |
JSONPath | Enter the JSON path where you want to add the new node. Use $ if you want to add node at root level. | Yes | String |
JSONKey | Enter the key of the node to be added in the JSON file. | No | String |
JSONValue | Enter the value to be added for the key mentioned above. | No | String |
JSONValueType | Enter the data type of the value being added as a value. Value type can be Boolean or Numeric. Keep the value type blank in case the data type is JSONObject, JSONArray, or String. | No | String |
...
JSON.AddNode “C:\Users\Qualitia\Cust_Details.json” “$.address” “PostalCode” "6932331" "Numeric"
End of the execution, this action add a new node as state and value as California under the node address.
...
JSON.AddNode “C:\Users\Qualitia\Cust_Details.json” “$.address” “StateCode” "["CA" , "California"]" ""
End of the execution, this action add a new node as state and value as CA and California under the node address.
JSON.AddNode “C:\Users\Qualitia\Cust_Details.json” “$.phoneNumbers” “ ” "~{ "type" : "landline", "number": "0123-4567-3263" ~}" ""
End of the execution, this action add a new node as to display landline number inside the node phoneNumbers.
...
This action removes the specified node from specified JSON file.
Input Parameters:
Parameter Name | Parameter Description | Mandatory | Data Types |
---|---|---|---|
FilePath | Enter the absolute file path to the JSON file from which you want to remove the node. | Yes | String |
JSONPath | Enter the node path which you want to remove from the specified file. This action will remove all the data present inside the node including array. If JSON path contains array, ensure you use an [] with index. Index starts from 0. | Yes | String |
...
JSON.RemoveNode “C:\Users\Qualitia\Cust_Details.json” “$.address.postalCode”
End of the execution, the node postalCode will be removed from the JSON file.
JSON.ConvertStringToFile
...
In case the JSON file does not exist at the specified location, this action creates a new JSON file. Also, if the file contains some data, this action will overwrite old data with new data.
Input Parameters:
Parameter Name | Parameter Description | Mandatory | Data Types |
---|---|---|---|
JSONString | Enter the JSON string which you want to add in the JSON file. | Yes | String |
OutputJSONFilePath | Enter the directory where you want to store the JSON file. | Yes | String |
...
JSON.ConvertStringToFile "~{ "firstName": "John", "lastName" : "doe", "age" : 26 ~}" “C:\Users\Qualitia\Cust_list.json”
End of the execution, a JSON new file will be added under the specified location with data as provided here.
JSON.ValidateStringSyntax
This action validates the JSON data given in the parameter.
Input Parameters:
Parameter Name | Parameter Description | Mandatory | Data Types |
---|---|---|---|
JSONString | Enter the JSON string which you want to validate. | Yes | String |
...
JSON.ValidateStringSyntax "~{ "firstName": "John", "lastName" : "doe", "age" : 26 ~}"
End of the execution, if the data is valid, action will pass, else action will fail.
JSON.StoreArray
This action stores the array data from the specified JSON path under the specified key. The key value can be retrieved using the key name.
Input Parameters:
Parameter Name | Parameter Description | Mandatory | Data Types |
---|---|---|---|
FilePath | Enter the absolute path to the JSON file from which you want to get and store array data. | Yes | String |
JSONPath | Enter the JSON path whose data you want to get and store under the specified key. If JSON path contains array, ensure you use an [] with index. Index starts from 0. | Yes | String |
Key | Enter the key under which you want to store the array data. | Yes | String |
...
JSON.StoreArray "C:\Users\Qualitia\Cust_Details.json" "$.phoneNumbers" "PhoneNumbers"
End of the execution, the array data present under the phoneNumbers JSON key will be stored under the PhoneNumbers key.
JSON.StoreAllUniqueKey
This action stores all the keys present in the JSON file. Multiple keys are stored separated by comma.
While executing this action, multiple instances of single key are counted as a single instance and it will be stored only once.
Input Parameters:
Parameter Name | Parameter Description | Mandatory | Data Types |
---|---|---|---|
FilePath | Enter the absolute path to the JSON file from which you want to get and store keys. | Yes | String |
Key | Enter the key under which you want to store the JSON keys. | Yes | String |
...
JSON.StoreAllUniqueKey "C:\Users\Qualitia\Cust_Details.json" "AllKeys"
End of the execution, the complete list of JSON keys will be stored under the AllKeys key. Here AllKeys will store "firstName","lastName","age","address","streetAddress","city","postalCode","phoneNumbers","type","number".
...
While executing this action, multiple instances of single key are counted as a single instance and it will be counted only once.
Input Parameters:
Parameter Name | Parameter Description | Mandatory | Data Types |
---|---|---|---|
FilePath | Enter the absolute path to the JSON file from which you want to get and store total key count. | Yes | String |
Key | Enter the key under which you want to store the JSON key count. | Yes | String |
...
JSON.StoreTotalKeyCount "C:\Users\Qualitia\Cust_Details.json" "TotalKeyCount"
End of the execution, the total number of keys will be stored under the TotalKeyCount (here, 10) key.
JSON.StoreSpecificKeyCount
This action stores the total number of instances of specified JSON key available in JSON file. The number is stored under the specified key.
Input Parameters:
Parameter Name | Parameter Description | Mandatory | Data Types |
---|---|---|---|
FilePath | Enter the absolute path to the JSON file from which you want to get and store total number of instances of the specified key. | Yes | String |
JSONKey | Enter the key name for which you want to store the count. | Yes | String |
Key | Enter the key under which you want to store the JSON key count. (case-sensitive) | Yes | String |
...
JSON.StoreSpecificKeyCount "C:\Users\Qualitia\Cust_Details.json" "TotalKeyCount" "type"
End of the execution, the total number of instances of the key type will be stored under the variable TotalKeyCount. Here, number 2 will be stored.
...
.UpdateValueInJson “C:\Users\Qualitia\Cust_Details.json” “$[0].address.postalCode” “6300194”
View image
XML Actions
Qualitia Automation Studio contains the following actions to perform operations on the XML files.
XML.UpdateNodeValue
XML.StoreNodeValue
XML.StoreAttributeValue
XML.StoreNodeCount
XML.VerifyIfNodeExists
XML.VerifyIfAttributeExists
XML.UpdateAttributeValue
XML.StoreEvaluatedXPathResult
Also, you can use ValidateStringSyntaxinFile to validates the syntax of an XML file.
...