How to Write Tests
1. To start with Swagger Functional Testing, click on the tile on the Swagger main page.

2. Your tests library opens. Click the Create Test button.

3. Now you can name your test and choose one of two options to continue:

Option A: Select endpoints from an existing API specification
This option lets you create a test using API specifications available in Swagger Studio.
Browse or search for APIs and select the endpoints you want to include.
You can select the entire API or specific endpoints.
Click .
Note
Selecting at least one endpoint disables the Add Endpoints Manually tab. Removing all selected endpoints re-enables it.
Option B: Add endpoints manually
This option lets you define endpoints manually,
Switch to the Add Endpoints Manually tab.

Define the endpoint details manually.
Click .
Note
Adding a manual endpoint disables the Select Endpoints from SwaggerHub Studio tab. Removing all manual endpoints re-enables it.
4. Your test now appears in the test library. Click on it to add more test steps.

5. You can choose your test step type by clicking the plus icon on the test steps list. You can also click on the big plus icon at the right bottom corner.

6. After you choose your Test Step type, fill in the details and click Save.

7. You can dynamically select values in an API response and assign them to a variable to use in another API request.

Go to Define an API request to learn more.
Tip
You can reorder test steps by dragging and dropping them. Move single or multiple steps up or down, even in and out of segments.
You can also duplicate selected steps in test cases. Duplicated steps appear right after the last selected step. If the last selected step is inside a segment, the steps are duplicated after the segment. Segments cannot be duplicated.
8. Once you complete all of the test steps, click the button at the top right corner.
9. Click to find more details connected to your test run.


10. Go to the tab, to see the list of all your test cases.
How to Add Test Steps from Endpoints Created in
Click the
+icon to add an API in your test definition view.
Select Create APIs step from OpenAPI spec.
Choose the APIs and endpoints from the modal and click the Add Test Steps button to proceed. You can choose the version of your endpoints.

Selected endpoints are added as test steps to your test.
If you add the step from a new parameter called baseURL is created and inserted before each endpoint path. You can update baseURL and add other variables and parameters from the test definition page above.
Click Execute Request to verify the response.
Enter a value and save the whole test by clicking the Save button.
How to Create Test From Swagger Explore
If you decide to create a test from the entire set of API endpoints, navigate to Explore and click on Create Test Case.
Select the endpoints you want to add to your test. You can choose an existing test case from the drop-down menu.

Click the Add Steps button to proceed.
Test case is created. Click Save.
You can now run your test case or create more test steps.