Creating a Variable at time of Test Authoring

Updated by Adnan Pandjou

A test variable is a defined name and value pair that stores and refers to information throughout a test and between tests. Having test variables allows for repeatability and reduces the burden of typing out the value each time it is needed.

In Sofy there are multiple ways you can create a test variable at time of authoring your test:

  • Select an element on your App and assign it as a variable, and
  • Create a variable when entering a value at time of test authoring.

Selecting an element on your App:

  1. After acquiring a device and during the test recording, click on the “Save Test Case Variable” icon located in the action bar
  2. Select the component whose text you want to save as a variable
  1. Review the selected component’s details, assign variable a name and save it.
  1. To use the recently saved variable, Click Edit Text, and select the variable “city” in this example.
  1. It’ll populate with the variable value.

Creating an element while entering a value:

  1. While authoring your test, click on the area where you want to enter a value

  1. This will result in a pop-up screen where you can either enter the text directly or create a variable during your test authoring process.
    1. To enter the text, simply type in the "Enter your text" filed.
    2. To create a new variable, click on the "Create New Variable" button and follow the guided steps for creating a variable
    3. You can also find a variable that was created in the past in the dropdown menu of "Select a Variable".


How did we do?