Table Driven Scenarios
A Twist Table Driven Scenario allows users to test business workflows using multiple data sets. The underlying implementation of the test remains the same, but the values for the parameters are picked from a data table and passed to the implementation. Each row from the data table starts a completely new execution run for the business workflow.
Create Table Driven Scenario
To create a Table Driven Scenario, you need to first create the Scenario. Once you have created a scenario which has parameters, you can right click and choose Create a Data Table for this scenario.
In the following Dialog box you can choose how you want to populate the data table. Twist can automatically detect all parameters in the business workflow and populate the data table, or you can choose to manually select the parameters that you want in the data table. It also gives you the option of making Twist automatically detect duplicate parameters.
- Choosing "Populate All data values":
- Choosing "No, I will select the data values myself":
Twist automatically detects all parameters in the business workflow and creates a column in the data table for each one. These are named Param0, Param1, etc. by default. What you see below is the parameter table. You use this parameter table to finalize how you want your data table to be created., using this you can rename parameters by clicking on them, or remove parameters. Once the list and names of parameters has been finalized, click "OK" to create the actual data table.
If you have context(s) with parameters in them, then these parameters will get populated in the data table as well.
Twist also allows you to choose the parameters that you wish to use in your data table. To add a parameter into your data set, simple click on it and it appears in the parameter table. These are named Param0, Param1, etc. by default. The parameters can then be renamed by clicking on them in the parameter table. Once the list and names of parameters has been finalized, click "OK" to create the data table.
In this example, a scenarios accepts parameters for age, health history and verifies the suggested premium matches the basic premium.
If you have context(s) with parameters, then you may select these parameters in the same way as other parameters
Merge Duplicate Data Values:
Twist will detect all duplicate data values, by doing a string match and create a single column in the data table for this. Changing the value in this column will affect all occurrences of this parameter. Un-checking this box allows you to choose parameters with same values as duplicate.
Modify Table Driven Scenario
- Insert Rows:
- Rename Column:
- Add Columns:
- Delete Column:
- Merge new parameter with existing column:
To add additional data sets to test your business workflow with, you can right click on the table and choose to "Insert Row" or "Insert Multiple Rows".. Once the rows have been inserted, you can click on cells to add test data.
For example, I have added 3 additional data rows for different age and health history.
To rename any of the Parameters in your test data, click on any of the data values in the column you wish to rename and then right click and choose the "Rename Column".
In this example, I have renamed the column "basic premium" (last column) to "minimum premium".
To add additional parameters to your test data, you first need add them to the business workflow you are testing. Once you have added a parameter to your workflow which isn't a part of the data table, right click on the parameter from the workflow and choose "Add Parameter to Data Table". In this example, I've added an additional step to enter the health test results, which I want to add as a parameter in the data table
You may also add parameters from context(s) to your data table. In order to do this, right click on a parameter in a context and click on "Add Parameter to Data Table". You may then type in the name of the column you want to add.
To remove a parameter from your test data, you can delete that column. Right click and choose "Delete Column"
If you wish to use the same table for an additional parameter in your workflow, place the cursor to the parameter and then right click and choose "Add Parameter to Data Table". In the following dialog box, pick the name of the existing column (parameter) you would like to merge with.
In this example, I already had a column "Name", which held the data for the second step of the workflow. I wanted to use the same data for the name in the first step of the workflow as well.
You may also merge parameters from context(s) to your data table. In order to do this, right click on a parameter in a context and click on "Add to Parameter Table". You may then select the name of the column you want to merge with.
Delete Table Driven Scenario
To stop using data the table data to drive the scenario, Right click and choose "Delete Table".