Skip to content
FunnelGuard

Fix guide by FunnelsGuard

2FA/OTP step blocking automated tests: how to fix it

CNV-298Medium impactDetectedBy FunnelGuardPublished Updated
On this page

What this issue is

Two-factor authentication (2FA) asks for a second proof of identity after the password. An OTP is a one-time passcode, sent by SMS or email, or generated by an authenticator app (TOTP). Many SaaS products also use OTP at signup to verify a phone number or email.

An automated test cannot read your phone or inbox by default. It reaches the code prompt and stops. The result is reported as blocked: the journey did not fail because of a bug, but nothing after that point was verified.

Why it costs you leads or sales

The steps behind a code prompt are often the most valuable: first login, onboarding, the activation event and the upgrade page. If monitoring stops at the code, a break there can go unseen for days. Real users hit the error and leave while your dashboard shows green.

Where a robot stops in a 2FA signup
  1. Signup formSubmits fine
  2. OTP promptCode sent to a phone or inbox the robot cannot read
  3. OnboardingNot reached
  4. Activation eventNot checked

The code step blocks the test, so later steps are unchecked.

Journey steps covered by monitoringExample numbers
Journey steps covered by monitoring (example)Blocked at OTP: 2 steps; With test path: 6 steps02526Blocked at OTPWith test pathsteps

Example: a 6-step signup journey, with and without a test path past the code step.

How to check if your site has it

Signs a code step is blocking your tests
  • Your monitoring or QA run stops at a screen asking for a 6-digit code
  • The test report says blocked, not failed
  • Signup or login sends an SMS or email code every time
  • No test account exists that skips or auto-fills the code
  • Pages after login (dashboard, onboarding, billing) have never been tested automatically

How to fix it

Add a safe test path past the code step
  1. Create a dedicated test account

    Use a clearly named account (for example a test address on your own domain) with no real customer data and minimal permissions.

  2. Choose a test path

    Options: a TOTP secret for the test account that your test tool can compute; a fixed code that works only for that account in a non-production or allow-listed setup; or a trusted-device or remember-me session for the test account.

  3. Restrict the path

    Limit it to the test account, never a global bypass. Log its use and rotate any secret on a schedule.

  4. Split the journey

    Test the pre-code steps (form loads, submits, code prompt appears) as one journey. Cover the post-code steps with a separate journey that starts from a valid session if you can set one up.

  5. Keep manual checks for the rest

    If no safe path exists, test the code step and what follows by hand on a set schedule, for example weekly and after every release.

Where to set up a test account by platform
  1. Use a test user

    In Users > Add New, create a test user. If a 2FA plugin is active, check its settings for per-role or per-user options and use the plugin's own backup or authenticator method for that user.

Example: compute a TOTP code for a test account (Node.js, otplib)javascript
import { authenticator } from 'otplib';

// Secret belongs to the dedicated test account only.
const secret = process.env.TEST_ACCOUNT_TOTP_SECRET;
const code = authenticator.generate(secret);
console.log(code);

How to confirm it's fixed

Confirmation checks
  • The test account passes the code step without a human reading a phone
  • The journey reaches the dashboard or first onboarding screen
  • The activation event fires and appears in your analytics
  • A normal new user in a private window still gets the code prompt
  • Test sessions are tagged and excluded from reports

How to prevent it happening again

How an unmonitored code step hides a break
  1. Day 0

    You change your auth provider settings. Onboarding after the code step starts erroring.

  2. Day 1

    Monitoring still reports blocked at the code step, which looks normal.

  3. Day 5

    Support tickets mention a blank screen after login.

  4. Day 5

    A test account with a safe path would have caught it on Day 0.

How FunnelGuard handles this

Questions people ask

Why does my automated test stop at the 2FA code screen?

The robot cannot read the SMS, email or authenticator app that receives the code. It reaches the prompt and stops, so the result is reported as blocked. Nothing after that step is tested.

How do I test a login that uses two-factor authentication?

Create a dedicated test account and give it a narrow test path, such as a TOTP secret your test tool can compute or a trusted-device session. Limit it to that account and log its use. Test real new-user flows by hand as well.

Should I turn off 2FA so my monitoring can run?

No. Disabling 2FA for real users weakens security and is not needed. Use a single test account with a restricted path instead.

Can a monitoring tool bypass OTP or CAPTCHA?

A responsible one does not. FunnelGuard never bypasses 2FA, CAPTCHAs or bot protection. It reports the step as blocked and checks what it can reach.

What does a blocked result mean in FunnelGuard?

It means the journey reached a 2FA or OTP step and could not continue. It does not mean your site is broken. The steps after the code remain unchecked, so cover them with a test path or manual checks.

How often should I test the steps behind a 2FA prompt by hand?

Weekly is a sensible minimum, plus after every release or change to your auth provider, SMS vendor or onboarding. Use a test account and note the date of each check.

Does a signup OTP step hurt tracking?

Not by itself. But if testing stops at the code, you will not see whether the signup or activation event fires after verification. Check it manually in GA4 or your ad platform's test tools.

Does FunnelGuard catch this?

Detected

FunnelGuard checks for this today.

How: login step stops at a code prompt: login_2fa_required (use a test account without 2FA); codes never entered.

Stop finding out from your customers

FunnelGuard runs your real forms and checkouts on a schedule, checks the tracking and the leads behind them, and alerts you once, with a screenshot. Try any paid plan free for 3 days.