Skip to content
All articles

Guides~7 min read

Login Test Breaks on a Security Question After Password

Why an automated login test breaks when the app asks a security question after the password, and how to test multi-step logins without a brittle script.

TL;DR

An automated login test breaks on a security question because the script encodes one fixed path, and the extra screen is a state it never planned for. The fix is to treat login as a flow with a verifiable outcome, not a fixed click sequence. TaloTrace navigates by sight and takes custom instructions for multi-step logins.

Key takeaways

  • Cause: A login script encodes one fixed path, so a conditional second screen is a state it has no step for.

  • Symptom: The failure often shows up in the first assertion after login, far from the screen that actually broke.

  • Common fixes: Bypass flags, hard-coded answers and mocked auth each trade away some of what the test was meant to prove.

  • Different approach: Define login by its outcome, not its click sequence, and let the tool read the screen it is actually on.

  • TaloTrace: Stored test logins take free-text custom instructions for steps beyond a simple form, and a goal counts as done only when a check proves the outcome.

What does this failure look like week to week?

A long-green login test suddenly reports a missing dashboard heading or a timed-out click. A release has added a step: after the password, the app asks a security question. The error points at the wrong place. The test did not fail at the dashboard; it was still on the security question screen, waiting for a page that was never going to load.

The question may appear only on some runs, some accounts or some environments, so the test goes green on a rerun, gets marked flaky and joins the tests nobody trusts. And because login sits in front of everything else, one broken sign-in step can take down every test that signs in through it, looking like a wave of unrelated failures with one root cause.

Why does a security question break a login test?

A scripted login test is a recorded sequence: type the email, type the password, click submit, assert something that only exists after sign-in. Each step assumes the previous one led to a known screen. The script has no concept of where it is, only of what is next. A security question is a state the sequence never modelled, so the next instruction refers to an element on a page that is no longer there.

Several properties of these screens make them especially awkward for automation:

  • They are conditional. Risk-based authentication treats new devices, browsers and locations as risk signals, so the same script can take different paths on different runs.
  • They are content-dependent. The question text can vary by account, so a selector or fixed step written for one question does not fit another.
  • They are deliberately hard to automate. Their purpose is to check that a person is present, so the app has little reason to make the screen easy for a script.
  • They change quietly. A security team can add or reorder a step without the test team hearing about it until the suite goes red.

Underneath all four is one mechanism: selectors and step sequences encode a page's structure at one moment, and login is a flow security and product teams change on purpose.

What do teams usually try, and where does it run out?

Teams usually add a branch for the question screen, bypass login with a test-only flag, session token or mocked auth, turn the challenge off in staging, or quarantine the test. A bypass is a legitimate choice for tests that are not about login; quarantine is honest. Each keeps something and gives something up.

ApproachWhat it keepsWhat it gives up
Add a branch for the question screenThe real sign-in flowExtra code to maintain for every new variant
Bypass flag, session token or mocked authSpeed and stabilityCoverage of the real sign-in flow
Turn the challenge off in stagingA green suiteParity with production behaviour
Quarantine the testA quiet pipelineAutomated coverage of the login gate

None are wrong in themselves, but each patches one script against one version of the flow, so maintenance grows with the number of variants rather than the number of tests.

What does a different approach look like?

Describe login as an outcome instead of a sequence of clicks. "The user is signed in and can reach their account" stays true when an extra screen appears. A tool working toward that outcome by reading the screen can handle a page the script's author never saw, provided it recognises which screen it is on and knows what to do where only you have the answer, such as a credential or an instruction for an unusual step. It also needs a firm definition of done: if a screen that looks like progress counts as a pass, you trade a loud false failure for a quiet false pass, which is worse.

How TaloTrace handles multi-step logins

TaloTrace navigates by looking at the screen, not by brittle element IDs, so it keeps working when the UI changes, and there are no test scripts to write or maintain. For access, you save the test accounts it should sign in with:

  • Saved once per project, each account carries a role label such as admin or viewer.
  • Sign-in is email and password, and you can add free-text custom instructions for logins that need steps beyond a simple form, such as an OTP prompt or a second screen.
  • A scenario can inherit the project default account, use a specific one, or run with no login at all.

Saved passwords are write-only and masked out of the run's captured steps and logs. When something does go wrong, every run is screen-recorded, each finding is independently verified before it reaches you, and it carries the time window in the recording where the defect shows.

Where are the limits?

Sign-in must include a password. Custom instructions are additive to a password, the add-account form requires one, and there is no password-less or SSO-only path in the product today. If your only sign-in route has no password, this is not the right fit yet.

Custom instructions cover logins that need steps beyond a simple form, with an OTP prompt or a second screen as examples; whether your particular challenge screen fits is something to confirm on your own app. The sign-up gate feature, where TaloTrace uses a throwaway inbox or number to receive a one-time code, is a best-effort convenience for getting through a sign-up wall, not a guarantee and not how existing accounts sign in.

If you are evaluating a tool, start with the login flow that already breaks your scripts: it is the most informative test you can run.

Frequently asked questions

Why does my login test pass locally but fail in CI?

Challenge screens are often conditional. An app may ask the extra question when it sees a fresh browser profile or an unfamiliar environment, and a clean test run looks like exactly that. Your local session may carry state that a clean run does not, so the second screen only appears in the clean run.

Should I just disable the security question in the test environment?

It gets the test green, but the test then stops covering a screen your users actually see, and a bypass hides any bug on it. A common approach is to keep a bypass for speed in some tests and keep at least one test that goes through the real flow.

Can TaloTrace sign in to an app with a second screen after the password?

TaloTrace sign-in is email and password, and you can add free-text custom instructions for logins that need steps beyond a simple form, such as an OTP prompt or a second screen. The password is required, and there is no password-less or SSO-only path. Check your specific flow while evaluating.

Is my test password exposed in TaloTrace results?

No. A saved password is write-only. It is stored for future runs, omitted from every read of the account, and masked out of the run's captured steps and logs.

See what TaloTrace finds.

Give Nico your application. Get back the journeys, the failures and the evidence.