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.

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.