If your application requires a login to perform tests, or if your test cases require making and verifying edits to a database, it's a best practice to create unique test accounts for each tester. This prevents testers from "stepping on one another's toes" while executing your tests. 

We recommend reading the following to learn about how to seed test accounts with the data needed for your tests and how to reset your test accounts

Why do we create unique test accounts? 

The reason is to avoid testers inadvertently updating each other's information and ensuring that the test results are accurate.

Rainforest tests should be optimized for speed and efficiency. Logging testers into separate, unique test accounts allows for simpler test writing, faster tests, and deterministic results. While creating sufficient unique test accounts requires initial work upfront, you greatly improve the quality of your results in many ways.

Pre-seeded accounts are a bit more nuanced. Consider these example scenarios you may want to test:

  • Perhaps it is essential that a power user, who has purchased over 1,000 dollars of goods is shown a specific advertisement.
  • A manager account with 25 employees should be able to view the employee detail pages, but the employees themselves should not see this page.
  • An insurance startup might need to confirm sending and receiving a completed document, but want to avoid the time-consuming process of filling it in

Consider any processes which require a lot of state setup before testing the core functionality. These are likely candidates for preset account types.

Creating test accounts

Once you've determined the account types that you require, you should script the creation of user accounts in the appropriate state. Save the accounts to your database, and save all of the individual login credentials for each different account type into a different CSV per account type. To make these available for testers, simply upload each CSV file into your rainforest account as new tabular variables.

Rainforest requires the following amount of test accounts per run:

Number of tests X number of platforms/devices the tests are executed on X 6

possible testers who will be sent to execute each test

So if I were running 20 tests across 3 browsers and devices, I would need 360 accounts as a minimum  (20 tests X 3 browsers X 6 testers).

Adding test accounts to your Rainforest QA account

Once you have the test accounts created, move them into a spreadsheet that can be saved as a CSV. Arrange the information similar to this example (title in row 1 and paired values in subsequent rows):

Testers will be able to access these accounts (or unique URLs) via a tool called Step Variables. Step Variables allow you to inject dynamic data like credentials into test steps.

  1. Navigate to the Step Variables settings page 
  2. Add a new Tabular Variable with a name like login
  3. Upload the CSV file 
  4. Click Create.

Note: Marking a variable as Reusable will allow the variable to be re-used as testers using the variable complete tests. This is useful if creating the needed amount of variables is not possible. 

The tradeoff of using this option vs adding sufficient tabular variables is the run may take longer because variables must free up for new testers to use them.

Reusing the test accounts

We recommend that you reset your database to a known baseline in preparation for every run. This allows you to reuse the test accounts you have in place, again and again, saving time, and reducing work.

Managing this reset is most efficient if you've integrated Rainforest with your CI tool. Resetting your database either before or after each run should be included in your existing CI configuration.

If you are not using any sort of CI tool, or haven't integrated with Rainforest, you can trigger a database reset using our webhooks.

Using Test Accounts for Test Writing

Writing tests yourself:

  1. When creating/editing a test, add a Step Variable by clicking the {} step variables text and clicking the variable you just created. 
  2. Save the step.
    Testers will receive one of the accounts provided when they execute the test.

Writing tests via Test Writing Service:

  1. Simply indicate in the description of what the test should cover what step variable you want the test authors to use

Note: Test Writing Service is an add-on feature, please contact us if you're interested in learning more!

Did this answer your question?