Skip to main content

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:

  1. Select Examples on the left-hand menu in the UI:

    Example Snippet Tab

  2. Next, you'll see some use case examples:

    Snippet List

    Select AUTHENTICATION > basic authentication. A brief description appears, when ready select Insert Snippet:

    Snippet Insert

    The result then displays in the console:

    Snippet Result

Insert a Snippet in an Existing Test

To insert a snippet into an existing test:

  1. Select Examples on the left-hand menu in the UI:

    Example Snippet Tab

  2. Select the component position by highlighting the desired component.

  3. Next, you'll see some use case examples, select DATA MANIPULATION > parse nested JSON. A brief description appears, when ready select Insert Snippet:

    Existing Snippet

    You will see the new snippet nested below your selected component position:

    Example Snippet Tab

  4. Finally, select Run to execute the test and ensure it runs properly.

Example is for Demonstration Purposes Only!

In the example directly above, our snippet placement is invalid. Make sure you review each object relationship before you continue.