Some testing scenarios require recording the same set of steps to get your application in a specific state, such as logging into an application, setting up test data, or navigating to a specific page or screen. To avoid spending extra time and effort maintaining similar test steps across different tests, use flows.
Flows are common sequences of test steps that you can insert into browser, mobile, or API tests and edit in bulk when changes occur. Read on to learn more about mabl’s options for creating reusable test steps with flows:
Example of a login flow
Flow basics
When you save a test with a new flow, mabl saves the flow to your workspace: Tests > Flows. When a flow is updated, the changes automatically propagate to all tests containing the flow. If you need to manage different versions of a flow, use branches.
Flows are test-type and platform specific:
- Browser flows - reusable within browser tests
- Mobile flows - reusable within the same mobile platform: Android or iOS
- API flows - reusable within API tests
Use the Flow type to filter flows for a specific test type.
Filtering for mobile iOS flows
Parameters
To scope variables to a single flow or to reuse a flow with different variables, add flow parameters. Flow parameters are variables that only exist inside a flow. Their values may be a static string or number or another variable, including variables from a DataTable.
Without parameters, a flow does the same thing every time. With parameters, you can control the data used in the flow. You can override the default value to customize the flow for different scenarios. If you are familiar with some common programming languages, you can think of flows as functions and parameters as input for one instance of the flow.
For example, if you create a flow that searches for a person based on their phone number, you can add parameters to search for a phone number that you created earlier in the test.
Example of a parameterized flow
Loops
A loop is a flow that repeats itself using a fixed number or variable. Loops are useful when you want to set up a sequence of steps to repeat based on real data in your application. For example:
- Asserting that a constant element appears across multiple pages
- Asserting that all elements of a dropdown appear
- Browsing through a list of search results until the correct item appears
Loops don’t require any code, making it easier to test complex user journeys that cover more of your application.
Loops are not supported for flows in API tests.
Learn more
To learn more about flows, parameters, and loops, check out the following articles: