Chapter 7. Background instance in test scenarios

In test scenario designer, you can use the Background tab to add and set background data for rules-based and DMN-based test scenarios. You can add and define the GIVEN data which is common for the entire test scenario simulation, based on the available data objects. Background tab has the ability to add and share the data among every test scenario. Data added using the Background tab can not be overridden by Model tab data.

For example, if the test scenario example requires the same value for the person Age in all test scenarios, you can define the Age value in the Background page and exclude that column from the test scenario table template. In this case, the Age is set to 25 for all test scenarios.

Figure 7.1. Example test scenarios with repeated value for Age

test scenarios with repeated value for Age

Figure 7.2. Example background definition of repeated value for Age

background definition of repeated value for Age

Figure 7.3. Modified test scenario template with excluded Age column

Modified test scenario template with excluded Age column
Note

The GIVEN data which is defined in the Background tab can only be shared between the test scenarios of the same *.scesim file and will not be shared among different test scenarios.

7.1. Adding a background data in rule-based test scenarios

Follow the procedure below to add and set a background data in rule-based test scenarios.

Prerequisites

Procedure

  1. Open the rule-based test scenarios in the test scenario designer.
  2. Click the Background tab of the test scenarios designer.
  3. Select an instance header cell in the GIVEN section to add a background data object field.
  4. From the Test Tools panel, select the data object.
  5. Click Insert Data Object.
  6. Select a property header cell to add a background data object field.
  7. From the Test Tools panel, select the data object.
  8. Click Insert Data Object.
  9. To add more properties to the data object, right-click the property header cell and select Insert column right or Insert column left as required.
  10. Use the contextual menu to add or remove columns and rows as needed.
  11. Run the defined test scenarios.

7.2. Adding a background data in DMN-based test scenarios

Follow the procedure below to add and set a background data in DMN-based test scenarios.

Prerequisites

Procedure

  1. Open the DMN-based test scenarios in the test scenario designer.
  2. Click the Background tab of the test scenarios designer.
  3. Select an instance header cell in the GIVEN section to add a background data object field.
  4. From the Test Tools panel, select the data object.
  5. Click Insert Data Object.
  6. Select a property header cell to add a background data object field.
  7. From the Test Tools panel, select the data object.
  8. Click Insert Data Object.
  9. To add more properties to the data object, right-click the property header cell and select Insert column right or Insert column left as required.
  10. Use the contextual menu to add or remove columns and rows as needed.
  11. Run the defined test scenarios.