Overview
Decision Actions in Functionize allow you to create conditional flows within your test cases. They enable an action to run only when a specific condition is met, based on the result of a previous step. This is especially useful when elements appear dynamically and should only be interacted with if they are present or visible.
Common use cases include:
Clicking a button only if it exists
Entering data into a field that appears conditionally
Skipping steps when an element is not available
What Is a Decision Action?
A Decision Action is implemented by using an Optional Verify Action. When a Verify Action is marked as Optional, any subsequent step that depends on it will only execute if the verification passes.
This approach helps prevent test failures caused by dynamic or conditional UI behavior.
How It Works
Steps to Set Up a Decision Action:
- Identify the action you want to make conditional.
- Insert a Verify Action just before that step.
- Set the Verify Action to Optional.
- Configure the Verify to check for the presence or visibility of the target element (e.g., a button, link, or input field).
- Add the conditional action (e.g., Click or Input) after the Verify step. This action will only execute if the Optional Verify passes (i.e., the element is present).
Example Use Case
Scenario- You want to click a “Next” button, but the button only appears under certain conditions.
Implementation
Add an Optional Verify Action to check if the “Next” button exists or is visible.
Add a Click Action for the “Next” button immediately after the Verify step.
Result
If the “Next” button appears → the click action runs
If the “Next” button does not appear → the step is skipped, and the test continues without failing
Best Practices
Always use Optional Verify Actions for dynamic or conditional UI elements
Place Verify steps immediately before the dependent action
Avoid hard failures for elements that are not always expected to appear
Use clear naming for Verify steps to improve test readability
Additional References
Please refer to the screenshots below for visual guidance on configuring Optional Verify Actions and conditional steps in Functionize.