Power Your Software Testing with AI Agents and Cloud
The Native AI-Agentic Cloud Platform to Supercharge Quality Engineering. Test Intelligently and Ship Faster.
- TestMu AI (Formerly LambdaTest)
- /
- Use Cases
- /
- Test a screen flow that branches on an answer
Test a screen flow that branches on an answer
Pick the sales path and the flow has to show a company field, not a support priority field.
Published on:
Declarative flows are business logic built by people who do not write tests, and they branch. A flow that takes the wrong branch collects the wrong information and nobody notices until the data is used.
This use case completes an intake flow on the Salesfource clone and checks the branch it took.
The flow under test
The branch assertion is the one that matters, and it works by checking what is on screen and what deliberately is not.
- The flow starts - screen 1 of 3, so the position in the flow is known.
- The branch is taken - a company name field appears and a support priority field does not.
- The branch completes - company and budget captured on the sales path.
- A record is created - with an id, a record type and a summary of what was captured.
Asserting the absence of the support field is what proves the branch rather than the form. A flow that renders every field from both paths would satisfy a presence-only check completely.
Note: Asserting that a field is absent is an ordinary step, which makes branch coverage in a declarative flow cheap to write. Start on TestMu AI. Start for free
The test file
The screen position is asserted at the start, so a flow that skips a screen or starts in the wrong place fails immediately rather than producing a confusing record at the end.
---
mode: testing
url: https://my-testing-repo-main.vercel.app/salesforce-clone-app/flow?reset=true
max_steps: 45
tags: [salesforce, crm, automation]
---
# Salesfource 28.5: Screen flow with branching
Catalog objective: complete an intake screen flow with branching.
Key assertion: the flow finishes with a success screen and a record is created.
## Start the flow
Verify the page title reads "Customer intake" on "Screen 1 of 3", choose the sales enquiry option, type "Sam Rivera" into "Your name", and click "Next".
## Verify the branch taken
Verify the flow took the sales branch by showing a "Company name" field rather than a support "Priority" field.
## Complete the branch
Type "Riverfield FC" into "Company name", type "50000" into "Approximate budget", and click "Finish".
## Verify the success screen and the created record
Verify a banner titled "Thanks - you're all set" appears naming a created record with its id, and the success screen shows a "Record type" and a "Summary" of what was captured.The final assertion checks the record type as well as the id, because a record created on the right path with the wrong type lands in the wrong report.
Step by step coverage
A start, a branch, a completion and the record.
| Step | What it proves |
|---|---|
| Start the flow | The flow opens at screen 1 and accepts the first answers |
| Verify the branch taken | The sales field is present and the support field is not |
| Complete the branch | The branch-specific fields accept input and finish |
| Verify the success screen and the created record | A record is created with an id, a type and a summary |
Each branch needs its own file. Two paths through one test file makes a failure ambiguous about which branch broke.
Running it
kane-cli testmd run tests/salesforce/screen-flow_test.mdAdd the support branch as a sibling file, since the whole point of a branching flow is that both paths work.
Declarative automation is edited by admins rather than engineers, which makes a readable test valuable to both. Generating the sibling branch covers producing the pair, and Kane CLI as a QA agent covers the wider suite.
Author
Bhawana is a Community Evangelist at TestMu AI with over 3 years of experience creating technically accurate, strategy-driven content in software testing. She has authored 50+ blogs on test automation, cross-browser testing, mobile testing, and real device testing. She also serves as Product Marketing Manager for Kane CLI, the command-line tool that runs browser automation from the terminal using natural-language flows in a real Chrome browser. Bhawana is certified in KaneAI, Selenium, Appium, Playwright, and Cypress, reflecting her hands-on knowledge of modern automation practices. On LinkedIn, she is followed by 6000+ QA engineers, testers, AI automation testers, and tech leaders.
Screen Flow FAQs
Did you find this page helpful?
TestMu AI forEnterprise
Get access to solutions built on Enterprise
grade security, privacy, & compliance
- Advanced access controls
- Advanced data retention rules
- Advanced Local Testing
- Premium Support options
- Early access to beta features
- Private Slack Channel
- Unlimited Manual Accessibility DevTools Tests




