๐ŸŽฐ Variables

Organize your text interactions with re-useable variables.

Waldo enables you to create and re-use variables for text interactions when recording your tests.

You can use those variables to standardize a value or to generate a new unique text every time your flow will be replayed.

What is a Variable?

A variable is a pattern that is used to generate text each time your test is replayed.

Variables are generally used when you need to generate a unique value for each replay. They can also be used to give an easily recognizable name to a long or complicated text.

Here's an example you may encounter where variables are a great benefit: To test the account creation in your application, you will need to ensure the email that Waldo uses for each signup is different or it will be rejected. This is where variables come in handy and allow you to create a test that will always generate a brand-new account.

The most common variables are:

  • Unique email (Signup email, member invitation, share feature...)
  • Unique text (Name, username, identification code...)
  • Constant text (barcode value, long description...)

How to create a variable

Creating a variable is very simple:

  • Start by launching the recorder.
  • Interact with your application until you reach the step to input text.
  • Select the input field. The Input Controls panel will show up at the bottom right of the recorder.
  • Click the Create variable to open the variables modal.
  • There, you can choose the name of you variable. There are some default patterns for email and phone inputs, but you can create any custom pattern you want. To insert a random set of Letters or Digits or Hexadecimals (for which you can define the length), just start typing # and a dropdown will appear to let you choose which type you wish to select. An example of the output is displayed below the definition input to help you visualize the output.
  • The variable is now created! You can use it and reuse it later in your test or during a test update.
  • Click the Send button or hit enter on your keyboard to use that variable on the device input.

There you have it! You have successfully created and used a variable! Keep in mind that the generated value, - even though it is can be based on a random pattern - will stay the same for your entire recording.

Suggested inputs

You don't need to create a new variable every time you are typing some text in your app. If you just type and send a chunk of text, it will appear in the suggested inputs section below variables. You will also be able to reuse it later on in your test creation flow, or when updating some tests.
Also note that when creating/updating a test with dependencies, you have access to the dependencies variables and suggested inputs.