Docs
Login options
To test what users see after signing in, the agent needs a way in. Add a test account to each environment. The agent never uses a real customer account.
Which option to pick
| Option | When to use it | Support |
|---|---|---|
| Test account you provide | Works for most apps: email or username and password. | Full |
| Test account with TOTP | Your app requires an authenticator app for 2FA. | Full |
| Agent signs up with a WitnessQA inbox | Also tests your sign-up and email confirmation. | Full |
| SMS 2FA | Not recommended. Turn off 2FA for the test account. | Limited |
| Google or SSO | Not recommended. Add email and password for the test account. | Limited |
Test account you provide
Create a dedicated account for the agent on that environment. Never use a real customer account or your own.
-
Create the account in your app
Sign up as a normal user on staging, or create the user from your admin panel. Give it the role you want tested.
A normal sign-up in your app. Use an address you control. -
Enter the credentials in WitnessQA
On the project page, click Add test account on the environment. Enter the sign-in page, the email or username and the password. The sign-in page must be on the same site as the environment, so the account is only ever sent to your own app.
The password is encrypted before it is stored, with a key that is not in the database. It is used only for this environment and is never shown again: not in the settings, reports, logs or videos. Changing the environment's address removes the saved account.
Enter the test account, then save and test it. -
Test the sign-in
Save and test sign-in signs in once in a real browser and says how it went. If it fails, the reason is shown in plain words, for example the error message your app showed. The environment card shows the result of the last sign-in, from a test or a run.
Add text that only a signed-in user sees, such as Dashboard, so the agent knows for sure the sign-in worked. Without it, the agent checks that the sign-in form is gone.
Test account with TOTP
If your app asks for a code from an authenticator app, give WitnessQA the TOTP secret. The agent generates the 6 digit code itself, the same way Google Authenticator or 1Password does.
-
Copy the secret when you set up 2FA
While setting up 2FA for the test account, click the link under the QR code, usually Can't scan it?, to see the secret as text.
Most apps show the secret as text under the QR code. -
Paste the secret in WitnessQA
In the test account, paste the secret into TOTP secret and click Save and test sign-in. Spaces and lower case are fine, and so is the whole
otpauth://link. Then click Show the current code to check it matches your authenticator app.The current code is shown so you can compare it with your app.
Agent signs up with a WitnessQA inbox
For each run the agent gets its own address, like run-8f2c1e@inbox.witnessqa.com. It signs up like a new
customer, then reads the confirmation email, OTP codes and magic links from that inbox. Public temp-mail services are
not used, because many apps block them.
-
Pick the inbox option
On the project page, click Add test account on the environment, pick Sign up with a WitnessQA inbox and enter the address of your sign-up page. Every run then signs up as a new user with its own address and a password made for that run, reads the confirmation mail, and goes on signed in.
Pick one option per environment. -
Allow the inbox domain if your app filters emails
If your sign-up blocks unknown email domains, allow
inbox.witnessqa.comon staging. If you use a CAPTCHA, turn it off on staging or use your provider's test keys.The inbox settings show the domain to allow. -
Watch the agent read the email
In the run, the inbox step shows the email the agent received and the code or link it used.
Step 6 of a run: the agent read the OTP from its inbox.
Protected staging
If your staging is behind a login wall, give WitnessQA a way through: on the project page, click Access on the environment.
Secrets are stored encrypted and never shown again. They are sent only to the environment's own address, never to other sites the page loads, like analytics or fonts.
Vercel Deployment Protection
In Vercel, open Project Settings → Deployment Protection and create a Protection Bypass for Automation
secret. Paste it under Bypass secret. The agent sends it in the x-vercel-protection-bypass header.
Basic auth
Under Basic auth, enter the username and password. The browser sends them only when your site asks, and you can use both: a Vercel secret and basic auth.
What the agent does while signed in
- It signs in once at the start of a run, then tests on desktop and on a phone with the same session.
- It looks at the first screen after sign-in, opens the main sections, opens one item from a list and checks the settings page loads.
- It fills forms but does not send them, never signs out, and never presses buttons like Delete, Pay or Send.
- Your app's own requests go through, so pages that load data with POST work as they do for a user.
- A wrong password is tried once only, so the test account is not locked.
If the sign-in fails
- Could not find a sign-in form. Use the address of the page with the form, for example
/login, not your home page. - The page says "Wrong email or password". Check the account on that environment, then enter the password again.
- The app asks for a 2FA code. Add the TOTP secret, or turn off 2FA for the test account.
- CAPTCHA. Turn it off for the test account on staging, or use your CAPTCHA provider's test keys.
SMS 2FA
SMS codes go to a real phone, so the agent cannot read them reliably. For the test account on staging, turn off 2FA or switch it to TOTP. If neither is possible, the run stops at the sign-in and says the app asks for a code.
Google or SSO
Google, Microsoft and SSO logins add bot checks and device prompts that break automated runs. Give the test account an email and password login on staging. If your app only has SSO, ask us about a test identity provider during early access.