Edit online

Run OpenAPI Test Scenarios

Oxygen XML Editor includes a testing tool for running OpenAPI test scenarios. The Run OpenAPI Test Scenario tool provides the ability to run a test suite for an OpenAPI document in JSON format. It performs the requests based on the specified OpenAPI document and the data entered in the test file, and then checks if the server responses are as expected.
Attention: This tool requires the OpenAPI Tester add-on (version 1.2.0 or newer) to be installed before it becomes available in the JSON Tools menu.

To use the tool, select Run OpenAPI Test Scenario from the Tools > JSON Tools menu. This opens a dialog box where you can specify the location of the test scenario file that you want to run.

Figure 1. Run OpenAPI Test Scenario Dialog Box

The scenario file must be valid according to the schema from here: frameworks/json/schemas/openapi/scenario/openAPIScenario.jschema. There is a default scenario file template available when creating new documents from templates and it can be found in the Framework Templates > OpenAPI Test Scenario. The template will automatically be validated against the schema.

For the scenario file, you have to specify the path of the OpenAPI document and the server where the requests are made. Then, for each test, you need to enter valid data for the required fields "path", "operation", "expectedResponse", and the optional fields "description", "parameters", "authorization", or "body".

After successfully running the test scenario, the results are displayed in a new JSON file.

Resources

For more information about OpenAPI editing, testing, and documenting, watch our webinar: