Skip Constraints

Learn about the new constraint feature that helps you implement conditional branching logic much easier.

Ivan Filippov avatar
Written by Ivan Filippov
Updated over a week ago

Skip constraints are a new feature in Hexawise. They are only available under the ‘Advanced Mode’. Skip constraints allow for certain parameters to be excluded from test cases when it is not appropriate for them to appear.

For example, let’s use this model below for a flight booking system:

In this use case, only customers who are in First Class get in-flight dining. Coach and Business class customers do not get in-flight dining. Therefore, test cases with Coach and Business class customers should have no value for “Food Choice”.

Some of you may remember this objective was previously achieved via “N/A” values and bound pairs as described in this article.

Skip constraints are a new approach that reduces the work needed for similar results.

First, navigate to Rules -> Constraints. Next, click this toggle to change to Advanced Mode - that is the only way to implement skip constraints:

Once in Advanced Mode, we use the following syntax for skip constraints:

Parameter[Parameter Value] >> Parameter to be skipped

So for our example, the syntax is this:

Now, when we generate our test suite by navigating to Scenarios, any row that includes “Ticket Type” as “Coach” will have no value for “Food Choice”:

To also exclude "Food Choices" from “Business Class”, we can add a second line like so:

Or we can include both parameter values in one constraint with the syntax below:

Note: As many parameter values as you want can be included in a constraint in that way.

Now when we generate Scenarios, tests cases with “Ticket Type” as “Business Class” or “Coach” both have no value for “Food Choice”:

You can also skip multiple parameters that are listed next to each other in the Parameters screen. For example, let’s say that Coach customers now get no food, drink, or checked bag. Thus, they should have blanks for each of those parameters.

First, we need to ensure that these parameters are listed next to each other in the Parameters screen, like so:

Next, we navigate back to the Advanced Mode page, and use the following syntax:

Parameter[Parameter Value] >> First Parameter to be skipped :: Last parameter to be skipped

For our example, that looks like this:

Now in our Scenarios, test cases with “Coach” for “Ticket Type” have no value for “Food Choice”, “Drink Choice”, or “Checked Bag”:

The final component of skip constraints is the ‘skip to end’ capability. In this case, we can tell Hexawise that for some parameters values, skip all parameters listed below it on the "Parameters" page.

So for our example, since “Food Choice”, “Drink Choice”, and “Checked Bag” are the last three parameters, we could use the syntax below to skip to end:

Parameter[Parameter Value] >> First Parameter to be skipped::!!

For our example, that looks like this:

And now the test cases under Scenarios with “Ticket Type” as “Coach” have no values related to Food Choice, Drink Choice, or Checked Bag

Lastly, you can do a quick review of available options & syntax by clicking the “Usage” button in the Advanced Mode

Did this answer your question?