Skip to content

Adding Dynamic Values Into Scripts

Random Numbers in Scripts

When writing tests to confirm the behaviour of new account creation you can’t reuse the same email or username.

Because of this we’ve added the ability to generate a random number of any length when using the Expect Text or the Input command.

To use this, simply add ${random-n} where you want the random number to go, n is the number of digits you want to generate.

Examples

Input loginEmailField In viewName ”${random-4}@filledstacks.com”

This will produce something like:

Input loginEmailField In viewName3453@filledstacks.com

To make it clearer, this is how it works:

  • ${random-1}: 6
  • ${random-2}: 64
  • ${random-3}: 648
  • ${random-4}: 6487
  • etc …