Testim Documentation

Welcome to the Testim documentation. You'll find comprehensive guides to help you get started quickly, example code snippets, and tips for being more productive. You will also find details about advanced features that allow you to customize Testim to fit your environment or special testing conditions. Don't worry, we'll support you if you get stuck. Let's jump right in!

Get Started    Guides

Generate random data with JS

Learn how to assign random data (user name, password, email etc.) to text fields dynamically

Any step in Testim can be parameterized. This means that a set-text step can not only have a value of the literal (e.g. "john@yourapp.io", "passw0rd!") which was recorded but any JS expression.

How to assign Random Data to a step?

Just replace the recorded value with JS expressions. Here are few examples:
Random email

Math.round(Math.random()*100000)+"@email.com"

Random password

Math.random().toString(36).slice(-8)

More random values

Date.now()+5

You can also assign variables if you defined them as parameters:

myVar + "sdf"

Tip: Consider using variables when you need to use the same random string several times (e.g. validate that the random email is later shown on a different page).Creating variables in a test (e.g. "myVar") is done by:

  • Passing params to a shared step (group/custom-js)
  • Exporting a value from the custom JS step into the containing group, e.g. add exports.myVar = "testim"; to your JS step.This will create the variable named "myVar" in the scope of the parent (containing) group. You can see an example in the export parameters doc (follow this link and search for exports.bestTestingTool = "Testim").

Learn more

Generate random data with JS


Learn how to assign random data (user name, password, email etc.) to text fields dynamically

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.