Most test cases are created as a result of recording a test case. However, sometimes, one or several requests or entire test cases can't be recorded and must be created manually. This is especially helpful for performance testing a restful API (REST). For these cases, you can use the Web API Test Builder.

To open the web API test builder, right-click on the Sessions Grid and select the Web API Test Builder option.

Or, from the main menu, select Tools > Web API Test Builder option.

The web API test builder should open in a new tab.

To create a new HTTP(S) request, you can complete the builder form or manually enter the Request content in the Raw tab.

Then press Send to issue the request and add a session to the bottom of the session grid. After that, you can add it to the test case as described in the Adding section here. 

Builder Options

  1. Select the request method.
  2. Type the absolute request URL, including the query string.
  3. Select the HTTP Version number (1.1 is the default).
  4. If you want to add more request headers (e.g., User-Agent or Accept), do not add the Content-Length header, as it will be added automatically.
  5. You can add a request body if you select the POST, PUT, or PATCH method.
    1. If you have a web form body, you can add name/value names.
    2. Check the Url-Encode names/values checkbox to URL-encode the names and values and add the Content-Type: application/x-www-form-urlencoded header.
    3. Select the Raw body radio button and type the request body if you have any other body. 

      Large request body

      In v5.7, the request body field was expanded to allow for bodies up to 2GB. 

Creating a test case

Once the API requests have been executed to create a test case, select the sessions from the session grid > right-click > Create Test Case. For more information on creating test cases, see here .

Note

Request Builder is only available in the Standalone version of StresStimulus. Using StresStimulus from Fiddler-Addon, use Fiddler's Composer feature to create requests.

Other options

Navigate to the Options tab to access further Web API options.

1. Server authentication

If your API request requires server authentication, the server credentials can be entered into the Server Authentication group.

2. Automatically creating a test case

Check the Automatically create a test case from a successful API call checkbox to create a new one from a successful API call.

Creating API requests from existing sessions

From the test case tree

Drag and drop a request from the test case tree to the Web API Test Builder.

From the sessions grid

Drag and drop a request from the sessions grid to the Web API Test Builder.


  • No labels