Using dynamic data in your test steps, you can inject information that changes from run to run. Define a list of values in a CSV file and upload it to Rainforest. Add a placeholder to a test step. When the test executes, the placeholder is replaced with a value from the list.
In this article, we cover:
- How to create dynamic data and upload it to Rainforest
- The number of values you must define
- How dynamic data is assigned
- How to add dynamic data into a test step
- Common use cases
Note: Variables are now called test datatest data - Placeholders that allow you to inject other values into your tests. Rainforest supports three types: dynamic, static, and built-in..
- Define the test data want to upload to Rainforest and save it in a CSV file that’s UTF-8 encoded.
For more information, see Calculating the Required Number of Data Rows.
In this example, we create two dynamic data placeholders:
- Open the Test Data settings page and click the Add New button in the Dynamic Data section.
Key in a name for your dynamic data group, consisting of letters, numbers, and underscores. Spaces and special characters are not supported.
Key in a description for your dynamic data placeholder so members of your team can understand at a glance the placeholder’s purpose.
Click the Choose File button to select the CSV file. When uploaded, each row is converted to a placeholder in the format
Now you can update your dynamic data as needed by clicking Edit or Delete on the right-hand side of any item in the list.
Note: To avoid disrupting your test runs, you must provide sufficient data for each tester. We cover this in the next section.
When a test executes, each tester is assigned one unique row of dynamic data. To ensure you have sufficient data for multiple testers, use the following calculation:
(Tests x Browsers or Platforms) x 6 Testers
- Tests. The number of tests in a single run.
- Browsers or Platforms. The number of browsers or platforms for each test.
- Testers. The maximum number of testers for each test.
Example Data Row Calculation
To successfully run 2 login tests using 3 browsers, the minimum number of required data rows is 36:
(2 Tests x 3 Browsers or Platforms) x 6 Testers
- If you don’t have enough data rows for the test, Rainforest displays an error; the test cannot run.
- If you created the required number of data rows, but more are needed, the test halts with an error.
Dynamic data is randomly assigned. Values do not repeat during a test run unless you mark them as reusable.
Marking dynamic data as reusable can significantly impact your test result time. Reusing data creates a gate system of “One out, one in” for your testers.
For example, say you have two rows of login data and three testers. The third tester cannot proceed until one of the other testers has finished. In terms of efficiency, it’s always better to add more data rows rather than mark something as reusable.
- In the step editor, click Insert Test Data to bring up the test data menu.
- Click any of the dynamic data groups to reveal the choices.
- Select the placeholder you want to insert.
The most common use case for dynamic data is assigning unique login credentials to each tester. Doing so helps to avoid shared state issues arising from a tester’s actions.
Once you’re familiar with how dynamic data works, you can use it to provide values such as:
- Login credentials
- Unique account information
- Product category codes
- Educational course names
We’re here to help. Reach out to us if you’re not sure how to take advantage of dynamic data.
If you have any questions, reach out to us at [email protected] or via the chat bubble below.
Updated 27 days ago