Task Progress0 of 3 Tasks
0%

Auth Flows

Practice the login flows that make end-to-end tests hard: a second step with a code from your inbox, a session that runs out in the middle of a task, and staying logged in between tests.

1. Two-Step Login

Challenge Tasks (1)

Tick a task when your script passes it. Tasks with a pass/fail box tick themselves.

Demo account: tester@qa.test / Passw0rd!

Inbox

No new mail

Log in with email, password and code

2. Session Expires Mid-Task

Challenge Tasks (1)

Tick a task when your script passes it. Tasks with a pass/fail box tick themselves.

Log in first (section 1) to start the wizard.

Finish the wizard

3. Remember Me

Challenge Tasks (1)

Tick a task when your script passes it. Tasks with a pass/fail box tick themselves.

Load this page with a saved session

4. Solutions

Try the challenges yourself first. Reference solutions are hidden until you ask for them.

About this Auth Flows page

Login flow automation is the practice of scripting authentication in browser tests, including multi-step sign-in, session expiry and remembered logins. Tests must handle a second verification step, detect when a session ends partway through a task, and reuse saved cookies or storage instead of logging in each time. This free page lets you practice all three with pass/fail results.

Frequently asked questions

How do you test a session timeout in automation?

Start a task after login, wait for or force the session to expire, then perform the next action and assert the app redirects to login or shows an expired message. Prefer shortening the timeout or clearing the session cookie over using long sleeps.

How does Playwright storageState work for login?

Call context.storageState({ path: 'state.json' }) after logging in, then set use: { storageState: 'state.json' } in the config. New contexts start with those cookies and localStorage applied. It does not capture sessionStorage, and saved state can expire, so refresh it.

How do you automate a two-step login in Selenium?

Fill the first step, click continue, then use an explicit WebDriverWait until the second step's field is visible before typing. Do not assume the second form is in the DOM yet. Assert both the success state and error messages for wrong inputs.

How do you test a remember me checkbox?

Log in with the box checked, close the browser context or reload, open the app again and assert you are still signed in. Repeat unchecked and assert you land on the login page. Check that the persistent cookie has an expiry date.

Is there a free site to practice login automation?

Yes. This page is free, needs no signup and runs in your browser. It has tasks with positive and negative cases, hints, and reference solutions in Playwright, Selenium Java, Selenium Python and Cypress.

Free developer tools on Randomly.online

QA Playground is part of Randomly.online. These tools help while you write and debug tests: