To pass data into a flow, we recommend using flow parameters so that you can customize your flow for different scenarios. However, if you don’t use flow parameters and use variables in the flow that are set from a different source, such as a prior test step, DataTable, or environment variable, mabl creates flow data-driven variables as a fallback mechanism.
The primary function of flow data-driven variables is to serve as a backup in case the flow gets imported into a test where these variables haven’t been defined.
This article explains how flow data-driven variables work.
Note
Flow data-driven variables are only supported in browser and mobile flows.
While flows in API tests can access variables set outside the flow, mabl doesn’t create flow data-driven variables as a fallback mechanism. If an imported API flow uses variables that are set outside the flow, the flow either accesses the variable as set by the test or treats the variables as undefined.
Creation of flow data-driven variables
If you create a flow that uses variables whose values are set outside of the flow, such as from a prior test step, environment variable, or DataTable, mabl creates flow data-driven variables when you save the test.
For example, imagine you create a flow that uses a variable userEmail
that gets its value from a DataTable scenario. When you save the test, mabl detects that the userEmail
variable is set from an external source and creates a flow data-driven variable.
This variable appears on the flow details page in the Data-driven variables section. The default value is set to the value that was used when the test was saved.
Importing the flow into other tests
If you import a flow with data-driven variables into a different test, the flow data-driven variables are added to the test as test data-driven variables when you save the test. This transition occurs so that you can customize the variables’ default values on a test-by-test basis.
These variables appear on the test details page in the Data-driven variables section.
If you delete the test data-driven variables that came from the flow, the test falls back to the flow data-driven variables as a backup. This process ensures that you never run a flow with undefined variables.
Editing default values
If the default value of a flow or test data-driven variable is no longer relevant, you can update it by clicking on the Edit variables button.