Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

How to branch to execute a different json assertion based on a status code value

Options
rickstag
rickstag Posts: 16

I would like to branch in my test after making a rest call based on the status code. For instance.
If the status code is a 200
Response Traffic -> JSON Assertor Good Return
else
Response Traffic -> JSON Assertor Bad Return

I realize I can have two different tests with datasets of positive and negative tests but I am trying to have all my tests in one dataset.

Comments

  • jakubiak
    jakubiak Posts: 801 admin
    Options

    Can you just add one test that gets a 200 response with the JSON Assertor Good Return attached to that, and then add another test that gets a different response code with the JSON Assertor Bad Return attached to that? Those tests could live in the same test suite.