Build a Browser QA Reset Workflow Step by Step
Why QA Test Data Resets Matter
Regression tests are only trustworthy when each run starts from a known state. A smoke test can pass, but if it leaves an order marked paid or a user profile changed, the next test can fail for the wrong reason.
A browser workflow can reset that state before tests run. Broma runs on the user's own computer, so the QA tester controls the profile. No public API is needed.
Pick a Dedicated Reset Target
Create a test account or sandbox dataset. Keep it separate from real data. Use a dedicated Broma browser profile so cookies and logins do not leak between tests.
- New profile for QA automation.
- Use test credentials.
- Reset only fields the workflow owns.
Step 1: Open the Page in the Right Profile
Start from a clean Broma profile. Open the application under test.
- Open Broma.
- Go to Profiles.
- Create a new profile for QA.
- Add the test login.
- Open the target page.
Step 2: List the State the Workflow Must Reset
Describe the task in plain language. For example: clear the customer phone number, set invoice status to draft, remove test line items.
Write the steps in execution order.
- Open Settings.
- Open Test Data.
- Clear field.
- Type value.
- Click Save.
If the reset touches multiple pages, split into sub-steps or use a loop if the same action repeats.
Choose Selectors That Survive Page Changes
Avoid deeply nested CSS selectors. Prefer stable attributes.
data-testid- Accessible name
- Stable text
document.querySelector('[data-testid]')
If Broma uses JavaScript expressions, keep them short.
Step 3: Add Reset Actions and Waits
Use open, click, type, wait, branch, loop, read text, screenshot.
Example sequence:
- Open
/settings - Wait for
[data-testid=test-data] - Clear
[data-testid=phone] - Type
555-0100 - Select
[data-testid=status] - Choose
draft - Click
[data-testid=save] - Wait for
[data-testid=success]
If the reset repeats over rows, use a loop with an explicit count. Keep the count explicit.
Add Branching for Known States
If save fails, branch to screenshot and log.
if error then screenshot
Step 4: Verify the Reset
Read text after save. Take screenshot. Check expected value.
textContent `[data-testid=status]`
If mismatch, branch.
Step 5: Run Before Regression and After Failures
Add workflow to pre-test checklist. Run manually or scheduled. Review run logs.
Running this workflow manually before each regression is simple. For a solo operator, schedule it or run it from a saved checklist. For a team, keep one shared reset flow and version it. The goal is not to test the reset itself forever, but to remove noise from the real regression.
Building the Reset Flow Step by Step in Broma
Start in the Broma app and describe the reset in plain language. The agent or manual builder should create steps in order.
- Open the target page.
- Click the settings or admin area.
- Clear fields.
- Type known test values.
- Select statuses.
- Save.
- Wait for success.
Then add checks. The flow should read text after save and take a screenshot. If the expected state is not present, branch to a failure path.
Use plain language for each action. For example, type means clear then type or set value. Select means choose option. Wait means pause until element exists or condition is true. Branch means if error then screenshot and stop or continue.
Handling Async Saves
Browser saves can be slow. A reset flow should not click and immediately read.
- Wait for the save button to be enabled.
- Wait for a success element.
- Wait for the status text to update.
This prevents flaky resets.
Using Profiles for Isolation
Keep QA reset profiles separate from daily automation profiles. Each profile can have its own cookies, logins, proxy, and extensions. For QA, use a dedicated test profile.
Why Reset Flows Break
Browser pages change often. A reset flow can fail when selectors move, async calls finish late, or saved state differs.
- Use waits for elements.
- Use stable selectors.
- Branch on failure.
- Verify.
Start with the smallest reset that removes ambiguity. If the app stores state in local storage or a backend, clear it through the browser only when the product allows. Avoid touching production accounts.
How to Describe a Reset in Plain Language
Write instructions like:
Open the settings page. Wait for the test data panel. Clear the phone field. Type 555-0100. Select draft. Click save. Wait for success.
Keep one action per line.
How to Check the Reset Without Guesswork
After save, read text. Take screenshot. Compare expected. If mismatch, branch to failure path.
read text status
screenshot reset
Read text can return the current status. Screenshot can capture evidence. Use these in the flow before branching. This makes the reset auditable.
Real-World Example: Resetting an E-Commerce Test Order
Before a release regression, a QA tester needs a clean order state. The workflow opens the admin dashboard, finds the test order, resets status, quantity, and price, then saves.
- Open Orders.
- Open test order.
- Set status to pending.
- Set quantity to 1.
- Set price to 0.
- Save.
- Verify.
This avoids flaky tests caused by leftover data. For example, before testing checkout, reset cart to one item, clear coupon, set shipping to test zone. Then run smoke test. The reset flow should be reusable for different test cases by changing typed values.
When to Use a Reset Workflow
Use a reset workflow when tests depend on clean state. Examples include form fills, order status checks, user profile edits, and dashboard data. Do not use it to bypass security or test real users.
Troubleshooting Broken Resets
- Selector changed: update selector.
- Save button disabled: wait for enabled.
- Wrong profile: check profile.
- State not cleared: clear via JS if safe.
Checklist for Reliable QA Reset Flows
- Dedicated profile.
- Stable selectors.
- Explicit waits.
- Branch on failure.
- Verify state.
- Log runs.
Keep reset actions separate from test assertions. The reset flow should set state. The test should verify behavior. Mixing them can make failures harder to read.
Review run logs after failures. A failed reset often means a wait was missing or a selector was wrong. Add the missing wait and rerun.
Keep the Reset Workflow Useful
Save steps, name clearly, version. Document expected state. Review run history. This makes the reset repeatable for solo operators and teams alike.
