Special Uses for Test Data

Learn how to combine placeholders to create unique data for testers.

Use test data to inject dynamic information into your test steps. Rainforest provides built-in test data, such as {{random.address_zip5}}, which populates a 5-digit zip code. You can create custom data to be used to meet the needs of various situations. Following are a few special use cases.

Combine Placeholders to Create Longer Strings

Concatenate two or more different test data placeholders. This is useful when you want to create unique names for testing things such as sign-up pages. Doing so helps to ensure the tester has a unique value to work with.


Concatenation Example 1

Combine {{random.address_zip5}} with {{random.first_name}} to produce {{random.address_zip5}}{{random.first_name}}

Result: “19345Alice”

Example of concatenated data as a username.Example of concatenated data as a username.

Example of concatenated data as a username.

Test Sending an Email from Your App to the User

Use {{random.inbox}} with {{random.email}} to test email verification.

{{random.email}}. This placeholder gives each of your testers a globally unique email address. It’s great for testing signup flows. Any email sent to {{random.email}} appears in its corresponding {{random.inbox}}.

{{random.inbox}}. This is a temporary, web-based email inbox similar to Mailinator.

A {{random.inbox}} example.A {{random.inbox}} example.

A {{random.inbox}} example.

Test Replying to an Email

Use the placeholder {{random.email}} wherever testers are required to enter an email address in your app. Then, when you want them to check whether the email was successfully sent, direct them to {{random.inbox}} and ask them to confirm the email is there.

Testers can reply once to an email in the inbox. Use an instruction such as the following:
“Reply to the email with the message ‘Hello’.”

Emails older than 30 days are automatically deleted. You can ask the tester to clear the inbox. To do so, instruct them to open {{random.inbox}} and click the Clear Inbox button.

Create Multiple Unique Email Addresses

Some workflows require testing multiple email addresses in a test. For example, {{random.email}}, which is typically used to provide a tester with a randomly generated email, provides a single email. However, for workflows requiring 2 or more unique email addresses, you can create a second email by combining two or more placeholders.


Concatenation Example 2

Combine {{random.first_name}}, “_”, {{random.password}}, and “@e.rainforestqa.com” to produce {{random.first_name}}_{{random.password}}@e.rainforestqa.com.

Result:[email protected]

Instruct the tester to access the inbox using the URL, which in this case is:

Append characters to create additional random emails. For example, {{random.first_name}}_{{random.password}}[email protected] and {{random.first_name}}_{{random.password}}[email protected].

Result: Rockman_y2ehSMZ61@e.rainforestqa.com and Rockman_y2ehSMZ62@e.rainforestqa.com, respectively.

For the inboxes use
http://e.rainforestqa.com/{{random.first_name}}_{{random.password}}1 and http://e.rainforestqa.com/{{random.first_name}}_{{random.password}}2.

Instruct the tester to access the inboxes using the URLs, which in these examples will be:
http://e.rainforestqa.com/Rockman_y2ehSMZ61 and http://e.rainforestqa.com/Rockman_y2ehSMZ62.

Use Test Data for Negative Testing

Negative testing helps to ensure your app can handle invalid data. For example, let’s say your sign-in flow calls for a password that is 6 characters long and contains at least 1 special character, such as an underscore or hash sign. If the password doesn’t meet the criteria, the app displays an error message.

To test whether the error triggers, you can instruct the tester to key in {{random.number}}, which generates a 9-digit string in the password field. Then, ask them to confirm that the error message is displayed.

If you have any questions, reach out to us at [email protected].

Did this page help you?