Skip to main content

Data-driven Testing

Data-driven testing is a testing methodology that involves using external datasets to drive the execution of test cases.

Test scenarios support importing external test datasets. When the test scenario runs, the system will run all the datasets in the data file in a loop, and assign the corresponding variables to the data in the dataset.

  1. Each dataset is allowed to contain multiple variables, and the corresponding value is read where the variable is specified when the API is running (variable priority: temporary variable > test data variable > environment variable > global variable).
  2. Multiple datasets can be created, and the system iterates through all datasets (each dataset is run once).
  3. Data sets are synchronized in the cloud, and test data is shared between members.
  4. You can set up different datasets depending on your environment.

Within a testing scenario, the capability to store multiple sets of test datasets is provided. You can select the specific test dataset to be utilized for the current run under the "Test Data" section of the testing scenario/scenario instance.

Edit Testing Data

In a testing scenario, multiple sets of test data can be added. Access the test scenario details page and navigate to the "Test Data" tab. Here, you can view or create new test data.

Within the test data, you have the option to include datasets, perform batch editing operations, add variables, or customize various environmental parameters. Additionally, you can import data from local files in json format or from csv files.

Run Testing Data

Before executing the test data, first select the required test dataset to reference, and then click the 'Run' button.

Use Testing Data

After the test data is imported into the test scenario, you can call the test data by referencing variables.

FAQ

How to Fix Garbled Characters after Importing Test Data?

On Windows systems, if you use Excel to export a CSV file, Excel will normally automatically use GBK encoding to save the file. This causes garbled characters when viewing CSV files in other software. In addition, older versions of Excel, such as Excel 2016, usually do not save the BOM (byte order mark) when saving the CSV file as UTF-8 encoded, which can also cause garbled characters when reading the CSV file.

Workaround:

Save the CSV file as an UTF-8 encoding format on a Windows system.

Available on macOS iconv -f GBK -t UTF-8 xxx.csv > utf-8.csv command transcoding files.