Why this is tricky

Two widgets, both requiring branching logic in your script rather than a single fixed locator: a field that only exists in the DOM under a condition, and an outcome that's different every time you trigger it.

Want a deeper, gradeable version of this? The Control Flow Lab module's Approval Router scenario adds a machine-readable pass/fail verdict on top of the same if/else shape.

Conditional field


Random outcome

Each click resolves to either a success or an error state — your script needs an if/else (or equivalent) to handle both.

Initial state.