Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Image Added


UI Expand
titleTable of Contents

Table of Contents

Introduction

In certain Scenarios, Test Case Designer allows you to define which parameter values should never be tested together. This is achieved by applying Constraints.

To guide the model, you can define Invalid Constraints (values that should

Table of Contents
maxLevel4

Overview

In specific scenarios, system allows user to define what parameter values can never be tested together or in the other hand, scenarios where parameter values can only be tested together. 
For that, user can apply constraints to support these cases.

So that the model can understand the requirements, you have the option to define invalid constraints (values that can never be tested together) , and/or bound constraints Bound Constraints (values that can only must be tested together) to train the model.

Invalid constraints

Invalid constraints restrict parameter values that can never be tested together.

. Important - regardless of the constraint type, the only function of this feature is exclusion of certain combinations from the Scenarios screen.

Invalid Constraints

Invalid Constraints prevent parameter values that should never be combined in a Test case.

For example (Figure 1), assume that the browser In this example, let's assume Internet Explorer (IE) is not supported on Apple computers so . In this case, it would be impossible for a tester to execute a test case that instructed them to launch IE from to Test a scenario where IE is launched on a Mac running on its native operating systemOS. AccordinglyTherefore, we do not want any tests generated to include combinations such as “OS X” and “IE8” in the same test case.

Image Removed

On the Rules ->Constraints screen, you will need to click on two red X’s. Hover over the first Value of the Invalid Pair and click on the red X that appears

Image Removed

...

Image Removed

As you enter your Constraints, you will see them listed to the left:

...

After you enter these two Invalid Pairs, clicking on the “Scenarios” button will create a completely new set of test cases that excludes those two pairs of Values (and only those two pairs of Values). Each test with ‘OS X’ as the operating system will have a browser other than IE.

As you use the Invalid Pair feature and the related Bound Pair one, keep in mind these usage tips:

...

Do you need to add a lot of Invalid Constraints?

...

Watch out for “Not Applicable” Values.

  • Do you need to add some of them to your plan? Do you need to invalidate the combination of “Not Applicable” with other specific Values?
  • Especially watch out for situations where you have multiple related “Not Applicable” values in a plan. Would it make sense to create a “Bound Constraint” between ‘Hotel Chain Preference = Not Applicable’ and ‘Type of Room’ = Not Applicable’?

you want to prevent the generation of Test cases that combine Mac OS and IE10 or IE11.

Figure 1 - BrowserImage Added

Figure 1 - OS and Browser


Creating Invalid Constraints

UI Steps
UI Step

Go to My Test Models (Figure 2 - 1) and open a Test Model (Figure 2 - 2).

Figure 2 - Test modelImage Added

Figure 2 - Test model

UI Step

You will enter the Parameters screen (Figure 3).

Figure 3 - ParametersImage Added

Figure 3 - Parameters

UI Step

Click Rules (Figure 4 - 1) and then Constraints (Figure 4 - 2) to access the Constraints screen (Figure 4).

Figure 4 - ConstraintsImage Added

Figure 4 - Constraints

UI Step

You will click two red X’s. Hover over the first value of the Invalid Pair and click the red X that appears (Figure 4 - 3).

UI Step

Find the second value that can never appear together with the first one, hover over it, and click the red X (Figure 5 - 1) to create your Invalid Pair.

Figure 5 - InvalidImage Added

Figure 5 - Invalid

UI Step

As you enter the Constraints screen (Figure 6), you will see the pairs listed (Figure 6 - 1).

Figure 6 - PairsImage Added

Figure 6 - Pairs

UI Step

After entering these two Invalid Pairs, clicking the Scenarios button will create a new set of Test cases that exclude those two pairs of values (and only those two pairs of values). Each Test with Mac OS as the operating system will have a browser other than IE.

Figure 7 - ScenariosImage Added

Figure 7 - Scenarios

As you use the Invalid Pair feature and the related Bound Pair, keep in mind these usage tips:

Tip

Adding Many Invalid Constraints

Imagine your app asks, Would you like to add a hotel to your travel reservation? Any Scenarios with Do Not Add a Hotel would require numerous Invalid Constraints between options like Do Not Add a Hotel and Hotel Chain Preference = X. In such cases, the Bound Constraint feature can help you handle constraints more efficiently.

If your model has more than 10 Invalid or Bound Constraints, it may be quicker to export your model into Excel to document paired values. To do this, follow these steps:

  • Add multiple paired values in Xray Test Case Designer before exporting, so you can easily copy the formatting for Invalid or Bound Constraints.
  • Ensure accurate spelling of values. Copying and pasting is safer than typing.

Not Applicable Values

Be cautious with multiple Not Applicable values in a model. For instance, does it make sense to create a Bound Constraint between Hotel Chain Preference = Not Applicable and Type of Room = Not Applicable ?


Bound Constraints

Bound constraints restrict parameter values that can only be tested together.

UI Steps
UI Step

Consider these parameters and values (Figure 8):

Figure 8 - ParametersImage Added

Figure 8 - Parameters

UI Step

You will see the following screen (Figure 9) when you click on the Scenarios button (Figure 8 - 1):

Figure 9 - RowImage Added

Figure 9 - Invalid Row

UI Step

Even though the Test calls for not adding a hotel (Figure 9 - 1)

Bound constraints

Bound constraints restrict parameter values that can only be tested together.

Consider these parameters & values:

Image Removed

You will have the following issue when you click on the “Scenarios” button:

Image Removed

...

, the data row proceeds to specify the preference and type of room, which is clearly incorrect.

...

To solve this, first, you

...

need to add

...

Not Applicable as parameter values

...

(Figure 10 - 1).

Figure 10 - ValueImage Added

Figure 10 - Conditional Value

...


This is because something will

...

have to appear in

...

the Test cases that include the

...

value Do Not Add a

...

Hotel (Figure 10 - 2).

We

...

want Not Applicable (Figure 10 - 1) to appear for both Hotel Chain Preference (Figure 10 - 3) and Type of Room (Figure 10 - 3) in every Scenario that includes the value

...

Do Not Add a

...

Hotel (Figure 10 - 2).

Info

The exact syntax of the conditional value and its position in the list don't matter

, it

. It could have been

"

N/A

"

as the last value.

...

UI Step

Now, we want to make sure that

...

Do Not Add a

...

Hotel (Figure 10 - 2) only gets paired with the

...

Not Applicable values (Figure 10 - 1). You have two options under the

...

Constraints tab.

One option is quick, the other is slow. Let’s see the slow option, first:

...

Figure 12 - InvalidImage Added

Figure 11 - Invalid constraints

...


Namely, it’s adding a lot of

...

Invalid Constraints as described

...

above.

...


Creating Bound Constraints

small
UI Steps
size
UI Step

Click on the green arrow icon to the right from the first value name (it appears on hover)(it appears on hover; Figure 12 - 1).

Figure 13 - ArrowImage Added

Figure 12 - ArrowImage Removed

UI Step

Click on the green arrow icon to the right from on the second value name (it appears on hover; Figure 13 - 1).

Figure 14 - ArrowImage Added

Figure 13 - ArrowImage Removed

UI Step

Confirm how you’d like to have the bound constraint operate:

Image Removed

Bound Constraint operate (Figure 14).

Figure 15 - BoundImage Added

Figure 14 - Bound


Most Most of the time, when you have “Not Applicable” Not Applicable (Figure 14 - 2) as an option, you will use “mutually bound constraints” Mutually Bound Constraints as in this case. Here, we want “Do Do Not Add a Hotel” Hotel (Figure 14 - 1) to be bound with Type of Room as “Not Applicable” AND Not Applicable and we want to have the Type of Room of “Not Applicable” Not Applicable to be bound with “Do Do Not Add a Hotel” Hotel so we mark this one as a Mutually Bound Constraintmutually bound constraint.

When you add a Bound Pair, the Xray Test Case Designer will constrain the first value chosen against all the other values in the parameter of the second value chosen. In the example above, creating a bound constraint

...

of Do Not Add

...

Hotel and

...

Hotel Chain

...

Preference =

...

Not Applicable means you are really invalidating these options:

...

  • Do Not Add

...

  • Hotel with

...

  • Hotel Chain Preference =

...

  • Marriott (this combination will never appear).

...

  • Do Not Add

...

  • Hotel with

...

  • Hotel Chain Preference =

...

  • Hilton (this combination will never appear).

...

  • Do Not Add

...

  • Hotel with

...

  • Hotel Chain Preference = Motel

...

  • One (this combination will never appear).

...

  • Do Not Add

...

  • Hotel with

...

  • Hotel Chain Preference = Vivanta by

...

  • Taj (this combination will never appear).

And because we created a

...

Mutually Bound Constraint, we are also invalidating

...

this combination: Do Add a

...

Hotel with

...

Hotel Chain Preference = Not

...

Applicable (this combination will never appear).

...

Tip
  • You can use the Invalid Constraint

...

  • feature to accomplish anything that the Bound Constraint feature can do.
  • The Invalid Constraint feature is frequently less confusing for new users. Don’t hesitate to use the Invalid feature instead of the Bound Constraint feature.
  • If you have more than 10 or so Bound Constraints or Invalid Constraints in a

...

  • model, you might find that it is easier and faster to document your paired values in Excel. If so, we would recommend

...

  • :
    • Adding multiple paired values before you export into Excel

...

    • .
    • Ensuring that you use the exact spelling of

...

    • values (e.g.,

...

    • cutting and

...

    • pasting is usually safer than typing).
  • Especially watch out for situations where you have

...

  • multiple related

...

  • Not Applicable values in a

...

  • model. Would it make sense to create a

...

  • Bound Constraint between, say,

...

  • Hotel Chain Preference = Not Applicable’ and ‘Type of

...

  • Room = Not

...

  • Applicable ? In the example above, it

...

  • would make sense to include that Bound Constraint. Every time

...

  • Hotel Chain

...

  • Preference = Not Applicable, we would want

...

  • Type of

...

  • Room to also be

...

  • Not Applicable. Similarly, every time

...

  • Type of

...

  • Room = Not Applicable, we would want

...

  • Hotel Chain

...

  • Preference to also be

...

  • Not Applicable. This is an example of a type of constraint that the human brain would handle effortlessly without even consciously applying logical rules.

...

Bound Constraints are rules for your model algorithm to ensure that two values must appear together. Knowing which type to use depends on your

...

model structure and business

...

and technology requirements.

We will be using this set of values to demonstrate (Figure 15):

...

Figure 16 - ValuesImage Added

Figure 15 - Values


To apply a Bound Constraint, you need to hover over value 1, click the green arrow icon to the right from the value name,

...

do the same for value 2, and select the appropriate option from the

...

three provided ones.

One-way Bound Pair

The underlying relationship type : is many-to-one, represented by WHEN-THEN statements in the left column.

We would like to exclude combinations like ‘Breed Breed of Animal = Shiba Inu’ Inu and ‘Type Type of Animal = Cat’ Cat from the generated scenarios.

We have 2 two breeds for each of the first 2 two types of animals. Therefore, we can set up 4 four one-way bound pairs from "from Breed of Animal" to "Type of Animal" (Figure 16):

Image Removed

Figure 17 - BreedImage Added

Figure 16 - Breed


You You can check your the logic by reading the statement at the bottom of the dialog (Figure 16 - 1).

The order in which you set the pair matters!.

In this case, we wouldn't be able to say WHEN ‘Type WHEN Type of Animal = Cat’ THEN ‘Breed Cat THEN Breed of Animal = Siamese’ Siamese because that would prevent 'Cat + Persian' from appearing, and would leave 'Persian" without any possible pairing (Figure 18).

Figure 18 - TypeImage Added

Figure 17 - TypeImage Removed

Note
You may argue that the statement at the bottom (Figure 17 - 1) still looks correct in this direction. However, however you need to keep in mind how the word "must" is interpreted by the algorithmalgorithm must interpret the word. Since the evaluation is done at the " pair of values " level, "must have Breed of Animal as Siamese" = "must NOT have Breed as Persian, Shiba Inu, Golden Retriever, Arabian" - of which "Persian" is incorrectly excluded. Therefore, therefore this direction wouldn't work for this example. We could use such direction if we had multiple types that can be with only 1 one breed.

Mutually Bound Pair

The underlying relationship type : is one-to-one, represented by ALWAYS-ALWAYS statements in the left column.

With Mutually Bound Constraints, the values are exclusive to each other. In this example (Figure 18), there is only one horse breed in the second parameter. So, with 1 one constraint, we can specify that "Horse" should not be paired with "Siamese, Persian, Shiba Inu, Golden Retriever" AND ", and Arabian" should not be paired with "Cat, Dog" - i.e., "Horse" and "Arabian" must only be tested together.

Figure 19 - BreedImage Added

Figure 18 - BreedImage Removed


The final set of rules for this model (in the verbal form) would look like this (Figure 19):

Image RemovedFigure 20 - FinalImage Added

Figure 19 - Final


In essence, Bound Constraints and Invalid Constraints perform similar tasks: they ensure that certain values only or never appear together - making all generated scenarios valid within the model scope. From a different point of view, Bound Constraints and Mutually Bound Constraints actually invalidate many values and Invalid Constraints bind many values, behind the scenes.

...


Skip

...

Constraints

Info

...

Skip

...

constraints are only available under the Advanced Mode

...

(toggle in the top left of the Constraints screen).


"Skip " constraints allow for certain parameters to be excluded from test Test cases when it is not appropriate for them to appear. It is a faster alternative to the "Not applicable" + Bound Pairs approach. However, as the feature is in the beta stage, please note that there are a couple open defects, specifically around the interaction of "Skip" constraints with the regular ones. So if you encounter any issues, feel free to reach out to Support or avoid skips for the time being.

How to Use Skip Constraints

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

Image Removed

 

Creating Skip Constraints

For example, let’s use the model below for a flight booking system (Figure 20):

Figure 21 - FlightImage Added

Figure 20 - Flight


In this model (Figure 20)In this model, only customers who are in First Class get in-flight dining. Coach and Business class customers do not get in-flight dining. Therefore, test Test cases with Coach and Business class customers should have no value for “Food Choice”.First, navigate to Rules→ Constraints. Next, click the toggle Food Choice. Additionally, Coach customers do not even get Drink Choice.

UI Steps
UI Step

Inside the model, we click Rules (Figure 21 - 1) and then Constraints (Figure 21 - 2) to access the Constraints screen (Figure 22) (the same way we did for Bound or Invalid constraints).

Figure 21 - ConstraintsImage Added

Figure 21 - Constraints

UI Step

Click the toggle (Figure 22 - 1) to change to Advanced Mode – that is the only way to implement

...

Skip Constraints.

Figure 22 - Advanced ConstraintsImage Added

Figure 22 - Advanced Constraints

UI Step

...

Once in Advanced Mode, we use the following syntax for

...

Skip

...

constraints:

...

Parameter[Parameter Value] >> Parameter to be skipped

or

Parameter[Parameter Value] >>

...

First Parameter to be skipped :: Last parameter to be skipped (The boundaries are inclusive)

So, for our example, the syntax is this (Figure 23):

...

Figure 23 - Skip Constraint SyntaxImage Added

Figure 23 - Skip Constraint Syntax

UI Step

...

The ability to include multiple values in the same

...

Constraint is an aspect of the Advanced Mode that is not limited to

...

Skip

...

constraints.

Now,

...

we generate our

...

Image Removed

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. Since we have those 3 sequentially in the table of parameters (refer to the model screenshot at the start of this article), we can use the following syntax:

...

Test suite by navigating

...

to Scenarios (Figure 24 - 1).

Figure 24 - ScenariosImage Added

Figure 24 - Scenarios

UI Step

Any row that includes Ticket Type as Business will have no value for Food Choice (Figure 25). Any row that includes Ticket Type as Coach will have no value for Food Choice or Drink Choice (Figure 25).

Figure 25 - Skips based on Ticket TypeImage Added

Figure 25 - Skips based on Ticket Type


UI Step

The final component of Skip Constraints is the skip-to-end capability. In this case, we can tell Xray Test Case Designer that for some parameter values, it must skip all parameters listed below (Figure 26) on the Parameters screen.

So, for our example, we could return to our Parameters screen and reorder the elements so that Food Choice and Drink Choice are the last two parameters (Figure 26):

Figure 26 - ParametersImage Added

Figure 26 - Parameters

UI Step

Then, we use the syntax below to skip to end:

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

...

!!

For

...

our example, that looks like this (Figure 27):

...

Image Removed

Now, when we generate our test suite by navigating to Scenarios, any rows with “Coach” for “Ticket Type” have no value for “Food Choice”, “Drink Choice”, or “Checked Bag”:

Image Removed

The final component of "Skip" constraints is the ‘skip to end’ capability. In this case, we can tell Xray Test Case Designer that for some parameters values, skip all parameters listed later (below) on the “Parameters” page.

So, for our example, we could return to our Parameters page and reorder the elements so that “Food Choice”, “Drink Choice”, and “Checked Bag” are the last three parameters:

...

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

For our example, that looks like this:

Image Removed

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

Image Removed

View a Constraint

UI Steps
sizesmall
UI Step

To view constraints, select the option "Rules" and then "Constraints" on the model

Image Removed

UI Step

A list with all the bound and invalid constraints will be displayed.

Image Removed

Edit a Constraint

...

Figure 31 - SyntaxImage Added

Figure 27 - Syntax

UI Step

Lastly, you can do a quick review of available options and syntax by clicking the Usage button (Figure 28 - 1).

Figure 32 - UsageImage Added

Figure 28 - Usage

Viewing a Constraint

UI Steps
UI Step

Go to My Test Models (Figure 29 - 1) and enter a Test Model (Figure 29 - 2).

Figure 28 - Test modelImage Added

Figure 29 - Test model

UI Step

You will enter the Parameters screen (Figure 30).

Click Rules (Figure 30 - 1) and then Constraints (Figure 30 - 2) to access the Constraints screen (Figure 31).

Figure 34 - ConstraintsImage Added

Figure 30 - Constraints

UI Step

A list with all the simple bound and invalid Constraints will be displayed (Figure 31)

Figure 31 - ConstraintsImage Added

Figure 31 - Constraints

Editing a Constraint

Info

It is not possible to edit a Constraint in the Standard View. In the Standard View, you are only allowed to delete and create a new Constraint.

UI Steps
UI Step

Go to My Test Models (Figure 29 - 1) and enter a Test Model (Figure 29 - 2).

UI Step

You will enter the Parameters screen (Figure 30).

Click Rules (Figure 30 - 1) and then Constraints (Figure 30 - 2) to access the Constraints screen (Figure 31).

UI Step

Change view to bulk (Figure 32 - 1). You can edit the Constraint type by selecting the corresponding operator (Figure 32 - 2). 

Figure 35 - EditImage Added

Figure 32 - Bulk Edit

UI Step

Once you're finished, click the Save button (Figure 32 - 3).

Deleting a Constraint

UI Steps
UI Step

Go to My Test Models (Figure 33 - 1) and enter a Test Model (Figure 33 - 2).

Figure 36 - Test modelsImage Added

Figure 33 - Test models

UI Step

You will enter the Parameters screen (Figure 34).

Click Rules (Figure 34 - 1) and then Constraints (Figure 34 - 2) to access the Constraints screen (Figure 35).

Figure 37 - ConstraintsImage Added

Figure 34 - Constraints

UI Step

To delete a constraint, hover the constraint and click the trash icon (Figure 35 - 1).

Figure 38 - DeleteImage Added

Figure 35 - Delete


Another option is to, in the Bulk view (Figure 36), delete the desired Constraint line (Figure 36 - 1).

Figure 39 - DeleteImage Added

Figure 36 - Bulk Delete

 

Expand
titleSupport/Troubleshooting

If you have questions or technical issues, please contact the Support team via the Customer Portal (Jira service management) or send us a message using the in-app chat.

It is not possible to edit a constrain at the Standard View. In the Standard View you are only allowed to delete and create a new constrain.

Delete a Constraint

To delete a constraint, hover the constraint and select the delete option:
Image Removed

...