Introduction
This section explains how to use the Forced Interactions feature of Xray Test Case Designer.
Forced Interactions are a method to train the model about specific business rules that must always be considered on the generated Tests, as long as the required values and outcomes. With Forced Interactions, the system will always make sure these interactions are added to your model output.
Forced Interactions enhance the precision, coverage, and control over Test Scenarios, making the testing process more robust and efficient.
Operations
When to Use Forced Interactions
If you need Xray Test Case Designer Tests to include a particular Test for a required business rule, for example:
Requirement: (#2947 – Notify about Certain High Risk Flood Zone Applications)
The business rule that you want to test reads, “if a regular applicant applies for a large loan in a flood zone with 90% LTV, send the notification to the manager.”
In our example, you must have these specific four values included together in a single Test:
- The customer status must be Regular.
- Loan to value ratio must be 90%.
- Loan amount must be Large.
- The property needs to be In a Flood Zone.
Go to the Forced Interactions screen under Rules (Figure 3) and add your Scenario.
Using Forced Interactions
Go to My Test Models (Figure 1 - 1) and enter a Test Model (Figure 1 - 2).
Figure 1 - Test model
You will enter the Parameters screen (Figure 2).
Figure 2 - Parameter
Click Rules (Figure 3 - 8) and then Forced Interactions (Figure 3 - 1).
Figure 3 - Forced
Click the respective fields to fill in the Name and/or Description of your forced Scenario (Figure 3 - 4; 5 - optional) and the Expected Outcome (Figure 3 - 7; optional).
Click the Forced Parameters Values (Figure 3 - 6) and select only the values you need to trigger your business requirement. A modal will open (Figure 4) for that.
Figure 4 - Modal
For example, if our model has 10 parameters, but the business rule only needs four to trigger, we include just those four in the Forced Interaction.
Once you're finished, click Save (Figure 4 - 1).
When you create your Tests, your Forced Scenario will appear in a newly generated set of Tests (Figure 5).
Figure 5 - Tests
- This feature is not just for “official requirements.” Consider including other critical elements in your Xray Test Case Designer-generated suite, such as a forced scenario that contains the most common value for each Parameter (i.e., the Happy Path).
- As noted above, you don’t need to specify every value. In fact, it’s better to only force the values needed to trigger the Requirement or business rule. This allows for the greatest variation in your Xray Test Case Designer-generated Tests.
- Keep the concept of Expected Results clearly separated from ordinary parameters and values in your mind. Treat them differently when entering your test models. Typically, you should not enter Expected Result values in the Parameters screen. The primary places to enter Expected Results are the Forced Interactions and Scripts screens.
- Use this feature selectively. Remember, many combinations will automatically appear in your Xray Test Case Designer-generated models without requiring any special action. For example, if a business rule only requires two values to appear together, that requirement will already be met when you create a 2-way (pairwise) set of Tests. You would only need to use this feature when ensuring that three or more specific values are tested together in a single test case.
Import Forced Interactions
You can import Forced Interactions, which allows you to upload data-driven Scenarios.
Go to My Test Models (Figure 6 - 1) and enter a Test Model (Figure 6 - 2).
Figure 6 - Test model
You will enter the Parameters screen (Figure 7).
Click Rules (Figure 7 - 8) and then Forced Interactions (Figure 7 - 1).
Figure 7 - Interactions
Click the Import button (Figure 7 - 2).
A modal will open (Figure 8). Click the Choose file (Figure 8 - 1) to select the file you wish to import, and then click Import (Figure 8 - 2).
Figure 8 - Modal
We recommend using the Excel template (you can download it from the link at the top of the dialog; Figure 8 - 3) and pasting your Scenarios in the table format to cell D1 (given you have Parameter names).