Skip to content
Help Center
Browse documentation

Add login credentials so TestOptim can sign in

Give TestOptim a test account so it can explore and test pages behind your login. Add one credential profile per role and see which one each run uses.

Updated 5 min read

To let TestOptim test pages behind your login, open your project's Settings and add a credential profile: a labelled set of sign-in details for a test account, stored on the project.

Before you start

  • Only the organization Owner and Admins can add or change credentials. A QA Lead can edit other project settings, but the credential fields are greyed out with the note "You need permission to manage credentials to change these profiles."
  • Create a dedicated test account in your app, on a staging environment, with only the access a normal user of that role has. Don't use a real person's account or an account with access to real customer data.
  • You can add credentials when you create the project, or later. The steps below use the project settings.

Warning

Never enter a production login, including for an admin panel. With a production admin account, the agent can change or delete live data, users and settings, because it submits the forms it finds. The Credential Profiles section of the project form shows the same warning.

Add a credential profile

  1. Open your project and select Settings in the sidebar.
  2. Under Credential Profiles (Optional), select Add profile.
  3. In Label, name the profile after the role it signs in as, for example Customer or Admin. Labels must be unique, and customer and Customer count as the same label.
  4. Fill in whichever sign-in details your app needs:
    • Username and Password for a normal login.
    • API Key, only if your login has no password. TestOptim types it into the password field when Password is empty. It isn't sent as an API header.
    • Login URL (optional), if your login page isn't on the project's main URL. Enter a path such as /admin/login or a full address.
    • Phone Number, for apps that sign in with an SMS code.
    • Test OTP / PIN, a fixed code your app accepts for testing. See One-time codes.
  5. Select Save changes.
A credential profile labelled Customer, set as the default, with username, password, API key, login URL, phone number and test OTP fields
A credential profile on the project settings page

If you add a profile and leave every field except the label empty, it isn't saved.

Several roles

If your app has more than one kind of user, add one profile for each, such as Customer and Admin.

The settings page with two saved profiles, Customer marked Default and Admin
Two profiles on one project
  • Mark one profile as Default. Only one profile can be the default.
  • If two profiles share a label, the form shows "Profile labels must be unique" and won't save.
A duplicate label error under the Label field reading Profile labels must be unique
Labels must be unique

Which profile is used

  • Exploration signs in with a single profile each time. With one profile, select Start exploration as usual. With two or more, the button becomes Explore as..., and you choose which profile to sign in as. If you don't choose, TestOptim uses the default, or the first profile.

    The Explore as menu on the Knowledge page listing the Customer and Admin profiles
    Choose a profile with Explore as...

  • Test runs use the default profile, or the first profile if none is marked default. Each test case starts signed out in a fresh browser. The testing agent signs in only for cases that need a signed-in user, so a case about a visitor who isn't signed in runs signed out.

Note

Each exploration uses the one profile you pick. After a run has saved knowledge, the button reads Re-explore as..., so you can explore again as another profile. The new run adds to what was found.

If you haven't added credentials

When you start an exploration on a project with no credentials, TestOptim warns you first. The agent can only explore pages that are public, without logging in.

The No Credentials Configured dialog with Cancel and Explore Anyway buttons
The warning shown before exploring without credentials

Select Cancel and add credentials, or Explore Anyway if your app doesn't need a login.

One-time codes and two-factor login

If your app sends a code by SMS or email at login:

  • Enter a Test OTP / PIN if your app accepts a fixed code for test accounts. TestOptim uses it automatically.
  • If you leave it blank, the exploration pauses at the login screen and emails you, so you can enter the live code. See Enter a one-time code when exploration pauses at login.

Warning

Only exploration can wait for a live code. Test runs and fix checks can't, so they can't sign in to a login that sends a code unless the profile has a Test OTP / PIN.

Are my credentials safe?

Passwords, API keys and codes are encrypted when they're saved. After you save, the screen never shows them again. The field shows "(saved — leave blank to keep)", so leave it blank to keep the current value, or type a new one to replace it.

The agent signs in and works through your app like a QA engineer. It never logs out, deletes accounts, makes payments, or changes passwords or account settings. It does fill in and submit forms, so use a test account and a staging environment.

What kind of test account should I use?

Use an account created only for testing, in a staging environment, with the permissions of the role you want covered. If your app has several roles, add one profile per role. Avoid accounts with access to real customer data, because the agent submits forms.

Update or remove a profile

Open Settings, edit the profile and select Save changes. To remove a profile, select the trash icon next to its Default option, then save.