Using the Example Snippets
Legacy Documentation
You're viewing legacy documentation for API Fortress (deployed via an on-premises container). To view documentation for the new SaaS version of API Fortress — now known as Sauce Labs API Testing and Monitoring (with Sauce Connect tunnels) — see API Testing on the Sauce Labs Cloud.
API Fortress offers a vast repository of API Testing examples that you can either use as templates or further add intelligence to an existing API Test.
Insert a Snippet in an Empty Test
To insert a snippet into an empty test:
-
Select Examples on the left-hand menu in the UI:
-
Next, you'll see some use case examples:
Select AUTHENTICATION > basic authentication. A brief description appears, when ready select Insert Snippet:
The result then displays in the console:
Insert a Snippet in an Existing Test
To insert a snippet into an existing test:
-
Select Examples on the left-hand menu in the UI:
-
Select the component position by highlighting the desired component.
-
Next, you'll see some use case examples, select DATA MANIPULATION > parse nested JSON. A brief description appears, when ready select Insert Snippet:
You will see the new snippet nested below your selected component position:
-
Finally, select Run to execute the test and ensure it runs properly.
In the example directly above, our snippet placement is invalid. Make sure you review each object relationship before you continue.