Skip to content
testmode

Troubleshoot automatic login

Fix Testmode’s automatic login: what each login failure means, from wrong passwords and missing login forms to credentials scoped to another environment, passwords not approved for a site, and tests that sign each other out.

When automatic login fails, the test fails before step 1 with a reason starting “Login failed” or naming the credential, and it isn’t charged. The session replay shows the login page as the browser saw it. With Self-driving on, a failed login in a scheduled, CI or plan run is investigated and reported as an environment problem, once for every test it stopped.

A test that failed at login with Login failed: Invalid email or password, No steps ran, and Not charged: no credits used.
The site’s own error message, quoted in the failure reason.
Failure reason Cause Fix
Login failed: the site’s message, such as “Invalid email or password” The site refused the username or password. Check the credential in a normal browser with the same details, then edit it and enter the password again.
Login failed: No login form or login link was found on the page The Login URL (or the environment’s URL) doesn’t show a login form or a link to one. Set the credential’s Login URL to the page with the form.
Credential “…” is for another environment only The credential is scoped to one environment, and the test ran on another. Pick a project-wide credential, or one for this environment.
The password of credential “…” was entered for … The login form is on a site the password wasn’t approved for, after an environment or login URL moved. Edit the credential, check the sites under Sites the password may be typed on, and enter the password again.
The start page … did not load The login page didn’t load at all. Check that the URL is right and reachable from the public internet.

The saved login expired or your app stopped accepting it. Testmode signs in afresh when the saved login is refused; if tests still start signed out, check that the start page shows a signed-in state Testmode can recognize, such as an account name or a “Log out” link.

Tests that share a credential share one login. A test that clicks “Sign out”, or an app that allows one session per user, ends the login for the others running at that moment. Give such a test its own credential, or set the credential’s Parallel browser sessions to 1, so its tests run one at a time.

“Waiting for the login on credential …” means one test is signing in for all of them. With Parallel browser sessions set, tests also wait for a free session, and the card says “Login limit for credential … reached”. Raise the number if your app allows more sessions per user.

The login needs a code, CAPTCHA or another site

Section titled “The login needs a code, CAPTCHA or another site”

Logins with a one-time code by email or SMS, a CAPTCHA, or a redirect to another site’s sign-in, such as “Sign in with Google”, can’t be automated. Use a test account with a plain username and password on the environment you test.