Variations
What are ‘variations’ in Testlum?
CSV is a file that contains compiled data for testing.
Variations play an important role in writing WEB automated tests. When your QA specialists are faced with testing the functionality of the fields and selectors, using 'variations,' they will be able to prepare the necessary data set quickly, which will be in tabular form inside the CSV file, and easily test the validation with the main functionality of the fields and selectors.
- Variations are effective for
Positive
andNegative
testing. - Data is often organized into tables, so CSV files are very easy and efficient to use.
Usage example:
We have a new user registration form, which consists of the following fields:
- User name
- EmailAddress
- Password
- Repeat Password
The structure of this CSV
file
will have unique field names with an enumeration of values for each of them.

When we link our CSV file to the scenario, it will run twice since the table has two rows with different data inside. Each run of the scenario will iterate through all the values in this file.
To test the functionality and validation of each field manually, it would take a lot of time to write test documentation and conduct manual testing, however, the usage of 'variations' will take much less time, and the efficiency will increase too.
Creation of such a CSV file with data for testing is quite simple because the CSV file consists of rows of data and delimiters that mark the boundaries of the columns. In one such positive or negative file, QA specialists will be able to sort through all possible sets of values that will help to test this functionality more effectively.
Usage of variation in 'settings'
To include variations in a script, add the value into the 'settings' command: <variations>file_name</variations>

test_1.csv
- the name of the brought-outCSV
file that is stored in a "data" folder.
Usage example of variations
in a scenario
<input comment="Input first name"
locator="registerAccount.firstName"
value="{{firstName}}"/> the usage of variation in `value`
<input comment="Input lastname"
locator="registerAccount.lastName"
value="{{lastName}}"/> - the usage of variations
<input comment="Input email"
locator="registerAccount.emailAddress"
value="{{emailAddress}}"/> - the usage of variations
<input comment="Input password"
locator="registerAccount.password"
value="{{password}}"/> - the usage of variations
<input comment="Repeat password"
locator="registerAccount.repeatPassword"
value="{{repPassword}}"/> - the usage of variations
Usage of 'variations' in 'repeat' command
To include variations in a 'repeat', add the value into attribute - variations="file_name".
Using variations in a 'repeat' will run the selected number of steps in the loop as many times as there are variations
Usage example of variations
in a 'repeat':
<repeat comment="Run variations in repeat" variations="variations_1.csv">
<web comment="Start WEB scripts">
<input comment="Input username" locator="forms.username" value="{{username}}"/>
<input comment="Input Email Address" locator="forms.email" value="{{email}}"/>
<input comment="Input Password" locator="forms.password" value="{{password}}"/>
<input comment="Repeat Password" locator="forms.repeatPassword" value="{{password}}"/>
<wait comment="Wait for 1 second" time="1"/>
</web>
</repeat>
Usage variables from 'variations' in the field of expected
files
With it we can add flexibility to the script and use different expected files for different runs with variations
Steps:
- It is necessary to create a variations file with data, where the names of the expected files corresponding to one step are written:

Variations file with test data
- Next to the scenario, expected files are created according to the name specified in the variations file:

expected files with names from variations file
- Enter the name of the variable from the ;variations; file in the field for the 'expected' file and, if necessary, in another field for the variable:

Example of using a variable from a variations file in the 'expected' and 'arg' fields

Example of using a variable from a 'variations' file in the field for 'expected' and 'endpoint' params
When an injection is made into the field for an 'expected' file, the pattern must follow: {{variable}}.json.