Reusable Flows
Create shared step sequences and reference them across multiple tests. Flows help you keep your test suite DRY and simplify maintenance of common workflows.
What Are Flows?
A flow is a named, reusable sequence of test steps that can be referenced from any test within the same project. Think of flows as functions for your tests — you define the steps once and call them wherever needed.
Common examples of flows include:
- Login flow — navigate to login page, fill in credentials, click submit, wait for dashboard
- Navigation flow — open the sidebar, click a specific menu item, wait for the page to load
- Form filling flow — fill out a multi-field form with standard test data
- Cleanup flow — delete test records, log out, or reset application state
Why Use Flows?
Without flows, you end up duplicating the same steps across many tests. This creates several problems:
- Duplication — the same login steps repeated in every test that requires authentication
- Maintenance burden — when the login form changes, you have to update every test individually
- Inconsistency — copied steps can drift apart as different tests get updated at different times
Flows solve all of these issues. When you extract common steps into a flow:
- Single source of truth — the steps are defined in one place
- Update once, fix everywhere — changing the flow automatically updates every test that uses it
- Cleaner tests — your tests become shorter and more focused on what they actually verify
Creating a Flow
Flows are managed from the dedicated Flows page within your project.
Navigate to Flows
Open your project and click the Flows tab in the project navigation. This takes you to the flows list, which shows all flows defined in the current project.
Create a New Flow
Click the New Flow button. You will be prompted to enter a name for your flow. Choose a descriptive name that indicates what the flow does, such as "Login as Admin" or "Navigate to Settings".
Add Steps
The flow editor opens with the same drag-and-drop interface as the test builder. Add steps by selecting actions from the action palette, configure each step's fields (selectors, values, timeouts), and arrange them by dragging to reorder.
Save the Flow
Click Save to persist your flow. The flow is now available for use in any test within this project.
The Flow Editor
The flow editor provides the same step-building interface as the test builder. You get access to all the same actions — Navigate, Click, Fill, Assert, Wait, Screenshot, and more — with one key difference:
The flow editor excludes the "Use Flow" action from the action palette. This prevents you from accidentally creating a flow that directly references itself, which would cause infinite recursion during test execution.
In the flow editor you can:
- Drag and drop steps to reorder them
- Edit any step's configuration (selector, value, description, etc.)
- Delete individual steps
- Add steps from the full action palette (minus "Use Flow")
The editor works identically to the test builder's step panel, so if you are familiar with building tests, you already know how to build flows.
Using a Flow in a Test
Once a flow is created, you can reference it from any test in the same project using the Use Flow action.
Open a Test
Navigate to the test where you want to use the flow and open it in the test builder.
Add a "Use Flow" Step
In the action palette, select the Use Flow action. This inserts a new step into your test at the current position.
Select the Flow
A dropdown appears listing all flows available in the current project. Select the flow you want to reference. The step displays the flow name so you can easily identify which flow will be executed.
Run the Test
When the test runs, the runner encounters the "Use Flow" step and resolves it by fetching the flow's steps and executing them inline. The flow's steps run in sequence as if they were part of the test itself.
Example: Login Flow
Suppose you create a flow named "Login as Admin" with these steps:
- Navigate to
{{baseUrl}}/login - Fill
#emailwith{{adminEmail}} - Fill
#passwordwith{{adminPassword}} - Click
button[type="submit"] - Wait for selector
.dashboard
Now in any test that requires authentication, you simply add a single "Use Flow" step pointing to "Login as Admin" instead of repeating all five steps. If the login form changes — say the email field becomes #username — you update the flow once and every test is fixed.
Nesting Flows
Flows can reference other flows through nesting. While the flow editor itself does not include the "Use Flow" action (to prevent self-referencing), a flow's steps are resolved at runtime, and a flow used in a test can call another flow that itself contains "Use Flow" steps pointing to yet another flow.
Nesting Example
Consider this structure:
- Flow: "Setup Session" — sets cookies, configures viewport
- Flow: "Login as Admin" — navigates to login, fills credentials, submits
- Test: "Verify Dashboard" — uses "Setup Session" flow, then uses "Login as Admin" flow, then asserts dashboard content
At runtime, the test runner recursively resolves all "Use Flow" steps, expanding each flow's steps inline before execution begins.
Depth Limit
To prevent infinite recursion from circular references, QA Studio enforces a maximum nesting depth of 10. If flow resolution exceeds 10 levels of nesting, the runner stops resolution and reports an error.
If Flow A references Flow B, and Flow B references Flow A (directly or through a chain), the runner will detect this when the nesting depth exceeds 10 and fail with a clear error message. Keep your flow hierarchy straightforward to avoid hitting this limit.
Flow Management
All flow management is done from the Flows page within your project.
Editing a Flow
Click on any flow in the flows list to open it in the flow editor. Make your changes to the steps, then click Save. The updated steps will take effect the next time any test that references this flow is run.
Deleting a Flow
To delete a flow, click the delete button next to it in the flows list. Be aware that deleting a flow that is referenced by tests will cause those tests to fail when they encounter the "Use Flow" step, since the referenced flow no longer exists.
Flows belong to a project and are available to all tests within that project. They are not shared across projects. If you need the same flow in multiple projects, you will need to recreate it in each project or use the Export & Import feature to transfer flows between projects.
Best Practices
Create flows for step sequences that appear in multiple tests. The most common and effective uses include:
- Login / Authentication — the most common flow. Almost every test needs to log in first, and login forms are a frequent source of selector changes.
- Navigation sequences — multi-step navigation through menus, sidebars, or breadcrumbs to reach a specific page.
- Form filling — standardized data entry for forms that appear across multiple features (user creation, product setup, etc.).
- Cleanup sequences — steps to reset state after a test, such as deleting created records, logging out, or clearing local storage.
- Setup sequences — pre-test configuration steps like setting cookies, accepting terms, or dismissing onboarding modals.
Naming Conventions
Use clear, descriptive names that indicate what the flow does and any relevant context:
Login as Admin— specifies the roleNavigate to User Settings— specifies the destinationFill Registration Form— specifies which formCleanup: Delete Test User— prefixes with the purpose
Using Flows with Environment Variables
Flows work seamlessly with environment variables. You can use {{key}} substitution syntax in any step field within a flow. This makes flows even more flexible — for example, a login flow can use {{username}} and {{password}} variables, allowing you to switch credentials by changing project variables rather than editing the flow.