Creating and Using Test Accounts in Rainforest
Learn how creating test accounts can help to ensure accurate test results.
Suppose your application requires a login to perform tests, or your test cases require updating a database. In that case, you should create unique test accounts for each tester. Doing so prevents testers from stepping on each other’s toes while executing your tests.
We recommend reading the following articles to learn how to seed test accounts with login credentials and reset your test accounts:
Why Are Unique Test Accounts Necessary?
Rainforest tests should be optimized for speed and efficiency. For example, if multiple testers log in using the same credentials, there’s a chance they could inadvertently update each other’s information. Doing so could cause your test to fail.
Logging testers into separate test accounts helps to ensure more straightforward test writing, tests that run faster, and accurate results. Creating a sufficient number of test accounts requires upfront work, but you’ll save time in the end by avoiding needless test failures.
Preset accounts are more nuanced. Consider these example scenarios:
- A power user who has purchased over $1,000 in goods must be shown a specific ad.
- A manager with 25 employees wants to view employee detail pages, but the employees should not have access to the page.
- An insurance startup needs to confirm sending and receiving a completed document, but they want to avoid filling it in.
Consider any processes that require 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 you require, you can script the creation of user accounts in the appropriate state. Save the accounts to your database, and save all the individual login credentials for each account type into a different CSV file per account type. To make these available for testers, upload each CSV file into your Rainforest account as new dynamic data.
Use this formula to determine the number of test accounts per run:
(Number of Tests x Number of Platforms or Devices) x 6 Testers
For example, if you run 20 tests using 3 browsers and devices, you require a minimum of 360 accounts.
(20 Tests x 3 Browsers) x 6 Testers = 360
Adding Test Accounts to Your Rainforest Account
After creating the test accounts, add the credentials to a CSV file. Arrange the information similar to the example (Title in row 1 and paired values in subsequent rows).
Testers access these accounts (or unique URLs) when data placeholders are inserted into a test step. Using test data allows you to inject dynamic data such as login credentials.
- Click the Settings icon (gear) in the navigation bar, then select Test Data.
- Add new dynamic data using a name such as “login.”
- Upload your CSV file.
- Click the Create button.
Reusable Data
Marking test data as Reusable allows more than one tester to access it. This is useful when you are unable to create multiple data rows. There’s a tradeoff, however. Using this option might increase test execution time as the next tester waits for the test data to become available.
Reusing Test Accounts
We recommend that you reset your database to a known baseline in preparation for every test run. Doing so allows you to reuse the test accounts you have in place, thus saving time and reducing the workload.
The most efficient way to manage the reset is to integrate Rainforest into your CI tool. Resetting your database before or after each run should be included in your existing CI configuration. If you’re not using a CI tool, or you haven’t integrated it with Rainforest, you can trigger a database reset using our webhooks. For more information, see Using Webhooks.
Using Test Accounts for Test Writing
There are two ways to use test accounts when writing your tests.
Creating the Test Yourself
- When creating your test, add test data by clicking the Insert Test Data link and selecting the added data.
- Save your changes.
Creating a Test via the Test Writing Service
Create a Test Writing Service request. Describe what the test should cover and include the test data you want the test author to use. For information, see Using the Test Writing Service.
Note: The Test Writing Service is an add-on feature. If you’re interested in learning more, contact our Support team.
If you have any questions, reach out to us at [email protected].
Updated about 1 year ago