Debugging Test Cases

We try to make it as hard as possible to fail by providing detailed error messages during creating and editing a test case definition. But sometimes it is still necessary to take a closer look at what you have build.

curl Requests

StormForger generates curl examples from your defined sessions to give you an idea what will be executed during the test run. While the actual test case execution happens in a more complex environment we offer a translation of all HTTP requests to a list of copy-paste curl-commands for debugging and introspection purposes.

  1. After saving or updating a test case you will be redirected to the test case detail page.
  2. Below the test case summary you will find a box labeled Sessions which lists all your defined sessions.
  3. Click on the session of interest and the session will expand presenting you all defined requests of the session as CURL requests.
  4. You can now just copy and paste them into your terminal.

Session Outliner

Checks and Assertions

You can also use checks and assertions to help you with identifying issues early on. Check out our guide on how to use checks and assertions.

Let's say you want to operate on items in your shop's basket. But you only can do that, if products have previously been added to the cart. You can use a check to see if you are set up properly:

session.get("/api/basket", {
  extraction: {
    jsonpath: {
      "item_count": "basket.item_count",
    }
  },
});

session.check("products_present", session.getVar("item_count"), ">", 0);

If you run a preflight test and see KOs for products_present you know that there seems to be an issue. This is particular useful to figure out why there are so so many errors happening later in the session - they might simply be consequential errors.

Call Log

To further inspect what your test run did in more detail, you can access a so called "call log". A call log is basically an access log containing basic information about requests that your test did perform.

You can access the call log via the context menus of a test run report:

Download/Preview Call Log

The call log consists of the following eight fields:

  • unix timestamp of when the response was fully received
  • HTTP method used for this request (GET, POST, etc.)
  • host the request was sent to
  • path and query parts of the request
  • HTTP status code
  • response size in Bytes
  • request duration (from start to finish) in milliseconds
  • tag used for this request

The call log is also available via our CLI using the forge test-run logs command:

$ forge test-run logs acme-inc/login/3
1530462072.428892;post;testapp.loadtest.party;/login?status=200;200;452;140.670;login
1530462072.975099;post;testapp.loadtest.party;/login?status=400;400;470;54.958;login
1530462073.703193;post;testapp.loadtest.party;/login?status=200;200;452;57.093;login
1530462074.046506;post;testapp.loadtest.party;/login?status=200;200;452;55.411;login
…

This will print out a preview of the first few thousand requests. To download the full call log, use the --full flag (maybe in conjunction with --file <file> to redirect the output to a file) .

Get started icon

Get Started

New to the StormForger?
With these guides you’ll be up and running in no time!

FAQ icon

FAQ

Already took a look at our FAQs?

Support icon

Support

Are you stuck? Talk to us! We're humans.

We are using cookies to give you the best online experience. If you continue to use this site, you agree to our use of cookies. By declining we will disable all but strictly required cookies. Please see our privacy policy for more details.


Accept Decline