Web Service Testing
This documentation section discusses web service testing-related features and configuration options.
Importing OpenAPI Documents
GUARDARA automatically generates test configurations based on OpenAPI 3 documents either uploaded as files or loading from a URL.
If you implemented your API documentation using multiple files, you must merge them into a single OpenAPI document. Alternatively, if all the documents are accessible from the network, you can provide the URL of the main document, and GUARDARA will automatically download the additional referenced documents.
The Static Analysis phase of the import process analyses the OpenAPI document for errors. You must address errors with fatal severity for GUARDARA to be able to create the test configurations and run tests against your service.
Schema Object Processing Customisation
It happens pretty often that, for example, multiple operations share a single Schema Object that defines the request or response body. However, some operations may not include certain parts of the data in the request or response. By default, GUARDARA processes the entire Schema Object and creates requests by including all parameters or object properties in the configuration. The
x-guardara-omit OpenAPI extension allows you to tell GUARDARA to omit specific parts of the Schema Object from the generated test configuration.
As an example, lets have a look at the following OpenAPI document. The example uses the
x-guardara-omit extension to tell GUARDARA not to include the User's
id in the
title: OpenAPI Extension Example
- url: http://localhost:8080/api/v1
summary: List all users
description: List of all users
summary: Create a new user
description: The user to be created
description: User successfully created
By default, GUARDARA performs a sanity check at the beginning of each test run to detect issues related to the test configuration or the web service. GUARDARA will provide further information in the Activity Log before the test terminates if an issue is detected. You must address the reported issues to be able to perform an exhaustive test.
Alternatively, you can disable the Sanity Check on the Runtime Options tab of the Project configuration. The option to disable the check is under the Analysis Options section of the screen. Please note that it is highly recommended to keep Sanity Checks enabled for the best results.
GUARDARA will ask for credentials during the OpenAPI document importing process if any Operations require authentication. If you wish to change the credentials later, you can do so by editing the Project configuration:
- Go to the Test Targets tab of the Project configuration
- Select the target using the dropdown menu on the top-right corner of the screen
- Expand the Authentication section of the target configuration to update the credentials