Creating a Variable at time of Test Authoring
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:
- After acquiring a device and during the test recording, click on the “Save Test Case Variable” icon located in the action bar
- Select the component whose text you want to save as a variable
- Review the selected component’s details, assign variable a name and save it.
- To use the recently saved variable, Click Edit Text, and select the variable “city” in this example.
- It’ll populate with the variable value.
Creating an element while entering a value:
- While authoring your test, click on the area where you want to enter a value
- 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.
- To enter the text, simply type in the "Enter your text" filed.
- To create a new variable, click on the "Create New Variable" button and follow the guided steps for creating a variable
- You can also find a variable that was created in the past in the dropdown menu of "Select a Variable".