
October 31, 2026

TestInspector supports conditional test logic through step-level conditions that evaluate variables, HTTP response values, or DOM assertions before deciding whether to execute a step. A test flow can skip an SMS verification step when a feature flag variable is set to false, or execute a retry step only when the preceding HTTP response code matches a recoverable error. The condition is evaluated at run time against the application's actual state, not hardcoded into the test structure.
This matters because real application flows are not linear. A checkout sequence might show a promotional discount field only for certain user segments. An onboarding flow might skip email confirmation for accounts created via SSO. A payment flow might surface a 3DS authentication step only for specific card types. A test suite that cannot respond to these branches will either fail on every run that exercises the alternate path or require separate, duplicated test cases for each variant.
Conditional logic in TestInspector is set at the step level, not the suite level. Each step can have an entry condition that uses the same variable interpolation syntax as the rest of the test — {{VAR}}, {{ENV_FLAG}}, extracted HTTP response values — evaluated against an operator (equals, not equals, contains, greater than, exists). When the condition evaluates to false, the step is skipped and the run continues to the next step. No code is involved in defining, updating, or debugging the condition.
Each test step in TestInspector has an optional condition field. The condition is expressed as a comparison: a left operand, an operator, and a right operand. The left operand is typically a variable reference — extracted from an HTTP response body, set by an earlier test step, pulled from an environment variable, or generated by a built-in like {{TIMESTAMP}}. The right operand is a literal value or another variable reference.
The available operators cover the majority of branching scenarios in web application testing: equals, not equals, contains, does not contain, starts with, ends with, greater than, less than, exists (value is non-empty), and does not exist. These handle checking whether a feature flag value is active, whether a response status code is in an expected range, whether an element has loaded into the DOM before attempting an interaction, or whether a token was extracted successfully from an earlier step.
{{FEATURE_NEW_CHECKOUT}} equals true. Set the variable at the suite level to match the environment configuration, and the step automatically skips in environments where the flag is off.{{RESPONSE_STATUS}} equals 200. Downstream steps that depend on a successful response are naturally gated by the status check.{{TOTP:secret}} exists, allowing the test to handle accounts with and without 2FA enabled in the same test flow.The most common source of condition values in TestInspector is the variable system. TestInspector supports variable extraction from HTTP response bodies (JSON path or regex), from page DOM elements (CSS selector or XPath), from HTTP response headers, and from run-time generators. A step earlier in the flow can extract a value — an account tier, a session flag, an API response code — and store it as a named variable. Subsequent steps can reference that variable in their conditions.
This creates a two-pass pattern: the first step fetches a resource and extracts a value; the second step uses that value to decide whether to proceed. A practical example in an e-commerce context:
/api/user/{{USER_ID}}/flags — extracts has_free_shipping from response body into {{SHIPPING_FLAG}}{{SHIPPING_FLAG}} equals true{{SHIPPING_FLAG}} equals falseBoth steps 2 and 3 are in the same test flow. On each run, exactly one of them executes based on the actual value the API returned for that user. The test validates the correct display state without requiring separate test cases for each tier.
Variable scope in TestInspector follows a hierarchy: step-level variables, suite-level variables, and organization-level variables with encrypted storage for secrets. Conditions can reference variables at any scope level, meaning an environment-level flag set once at the organization level gates steps across every suite that references it.
The most direct value of conditional steps is eliminating false failures caused by optional application behavior. The table below maps common scenarios to the condition type that handles them:
| Scenario | Without conditional step | With conditional step |
|---|---|---|
| Cookie/privacy banner appears on first session only | Test fails when banner is absent; requires separate test per session state | Dismiss-banner step runs only when banner element exists in DOM |
| A/B test shows different UI variants | Test fails on the variant it was not written for | Each variant's assertion step runs only when its flag variable matches |
| 2FA prompt appears only for high-risk sessions | TOTP step causes error on sessions without 2FA | TOTP step runs only when 2FA challenge element is present |
| Payment 3DS step required for some card types | 3DS interaction fails when card does not require it | 3DS steps gated on extracted {{REQUIRES_3DS}} variable |
| Email verification skipped for SSO accounts | Test flow includes steps that never appear for SSO users, causing failures | Verification steps run only when account type is not SSO |
Conditional steps solve these cases without duplicating test flows. The same flow runs across all variations of the application state; steps that do not apply are skipped transparently. This is especially important for test suites that run across multiple environments where behavior differences would otherwise require environment-specific test files.
TestInspector's self-healing mechanism runs when a step's selector fails to locate a target element: it uses AI selector suggestions to identify the nearest matching element and retries the interaction. Conditional steps and self-healing operate at different levels and complement each other: self-healing handles selector drift (the element is present but its locator changed), while conditional steps handle presence/absence decisions (the element may or may not be present depending on application state).
A robust pattern for optional UI elements combines both:
{{ELEMENT_EXISTS}} equals true.This means the test will not fail when the element is genuinely absent (conditional skip), will not fail when the element's selector has changed slightly (self-healing retry), and will only fail when the interaction should have worked but did not. For QA teams managing large test suites, this distinction between correct absence and a broken element is the difference between actionable failures and noise.
The conditional step approach also reduces maintenance burden when application flows change. When a feature moves from beta (behind a flag) to general availability (flag removed), the only change needed in the test suite is removing the condition from the relevant steps — no test files to refactor, no branching logic in code to update. You can read about the broader approach to no-code automation at TestInspector and explore how test automation services from Astaqc support teams building conditional flow coverage at scale.
In code-first frameworks like Playwright and Selenium, conditional logic is written in the test language using standard programming constructs. This gives experienced developers significant flexibility but introduces maintenance costs for teams where QA engineers may not have a development background. The table below compares the key trade-offs:
| Dimension | TestInspector (no-code) | Playwright / Selenium |
|---|---|---|
| How conditions are expressed | Step-level condition field with operator dropdown and variable reference | JavaScript/Python if/else blocks, helper functions, conditional expect calls |
| Who can add or modify conditions | Any team member with step edit access, no programming required | Anyone able to read and write the test language (typically SDET/developer) |
| Condition visibility in CI run logs | Skipped steps are logged with the condition value that caused the skip | Skipped steps require explicit logging; absent logging, skips are silent |
| Risk of conditional logic becoming untested code | Low — conditions are data fields on steps, not code paths | Higher — conditional code branches may not be covered by any test of the tests |
| Maintenance when application flow changes | Remove or update the condition field on the step | Refactor the conditional code block; update helper functions if shared |
The key trade-off is expressiveness vs. accessibility. Playwright and Selenium can express arbitrary conditional logic, including nested conditions, loops, and shared helper functions. TestInspector's condition system covers the cases that appear in most web application testing without requiring programming skill to configure or maintain. For QA teams where the bottleneck is the development requirement rather than the logical complexity of the conditions, TestInspector's model scales test coverage without scaling the development skill requirement. See the manual testing vs automated testing guide for context on where no-code tools fit within a broader test strategy. Teams with complex nested conditional requirements remain better served by code-first frameworks; for help evaluating the right approach for your team, see hire QA team.
TestInspector conditions are set at the step level, not the block level. Each step has one condition evaluated independently. Nesting is not supported in the way nested if/else blocks work in code. Complex multi-branch logic is handled by extracting intermediate values into variables and assigning conditions to each dependent step. Most web application testing scenarios can be expressed this way.
By default, a step with an unsatisfied condition is skipped and does not cause the run to fail. If the intent is to assert that a condition must be true before proceeding, the preferred approach is an explicit assertion step before the conditional group. A failed assertion causes the run to report failure; a skipped step does not. This distinction lets teams control which unmet conditions are meaningful failures and which are expected skips.
Skipped steps appear in the run log with a skipped status and display the condition expression that evaluated to false. This distinguishes a deliberately skipped step from a missing step and provides the condition value at the time of evaluation. Run logs are accessible via the TestInspector web interface and via the CI/CD API endpoint for programmatic access and reporting.
Yes. Conditions can be applied to any step type: browser interaction steps, HTTP request steps (GET, POST, PUT, PATCH, DELETE), accessibility assertion steps, and visual regression steps. A single test flow can mix step types with independent conditions on each, allowing a flow that begins with HTTP checks and continues with UI interactions to branch at any layer.
Visual regression steps capture a screenshot and compare it against a baseline using SSIM. The comparison outcome is not currently exposed as a variable that downstream step conditions can reference. Conditional logic based on visual regression results requires a separate flow design where the visual check is the final gating assertion rather than an intermediate condition.
Step conditions evaluate at run time regardless of how the run was triggered — via the scheduler, a CI/CD API call, a manual run, or a cron job. A CI/CD API trigger can pass environment-specific variable values that change which steps execute in staging versus production. The same test suite can serve as both a staging smoke test and a production canary test, with environment-specific behavior governed by the variables passed at trigger time.
Teams evaluating TestInspector for test flows with conditional logic can review the full feature set at the TestInspector product page. For teams that need help designing a test automation strategy that includes conditional flow coverage, Astaqc's test automation services and testing documentation work include conditional test design for complex web applications.
A test suite that cannot respond to branching application behavior will either fail on every run that exercises the alternate path or require separate, duplicated test cases for each variant.

Sign up to receive and connect to our newsletter