Data-driven Testing

Run the same test with different data

Data-driven testing is a software testing technique that separates test data from test scripts. It enables testers to reuse test scripts for different sets of data. Scandium provides built-in features to help you run various test data in just one test case by importing your test case in either Excel, CSV, or JSON format into Scandium.

When a data source is added to a test case, running the test case will run for each row in the datasets of the uploaded spreadsheet.

How to import a data source to a test case on Scandium

  1. Record your initial test scenario as usual

  2. Create a spreadsheet containing your data set from any Office suite software. Ensure the first row of your data set contains the column header names. These columns will be referred to as corresponding variables within your test. Save and download the file on your computer.

  3. On Scandium, click the Settings Icon ⚙️ on the test case page.

  4. Click the "Upload File" button and select the file you want to upload (created from step 2)

  5. Once the file has been read, its content will be displayed in JSON format in the text editor below the button. Click on the Save button to save your changes.

  6. Click on the Back arrow to go back to the list of steps

Using imported data as variables within steps

Now that a data source is imported and attached to a test case, you need to update the steps in which you desire the columns from the data source to be used.

On the test step of where you want the data imported to reflect, click the ⊕ button, the click settings icon ⚙️ of the step

In the “text to assign” text bar, delete the existing text data

Click on the "Insert Variable" button

In the ensuing modal that displays the list of variables you can select, you should see that each header in the spreadsheet you uploaded has now been mapped to a variable name, with an indicator that shows that the variable is from an external file (the data source). Select the appropriate column from the list.

Repeat this for all steps that need input from the data source.

Upon selection, the selected variable will be inserted into the "Text To Assign" field of the step

You can now save and run your test.

Note: Data driven testing will trigger multiple test runs for the same test, so be aware of the usage required before using.

For example, if your spreadsheet contains 101 rows (including the headers), the test will run 100 times anytime you run it.

On the local runner, Scandium will only run the test for the first 10 rows

You can view the result of a data-driven test run by visiting the Suites Results menu.

Last updated