How can we help?

Data driven testing

You are here:

Data driven testing (DDT), also known as table-driven testing or parameterized testing, is a software testing methodology used in the testing of computer software to enhance tests using a data set table directly as test inputs and verifiable outputs. In the simplest form, it supplies the inputs from a row in the data set table and expects the outputs which occur in the same row.

Basically, data driven testing lets you define parameters/variables in your tests and have a data set with multiple scenarios for which you need to run the same tests.

With Trudon, any test can be parameterized to be re-executed for every scenario in a given data set. With such a straightforward approach, you can quickly increase the test coverage of your application without creating more tests.

Create a data driven test

Creating a data driven test with Trudon is as simple as creating a regular test. You just have to record a test as you would normally do and then go to the test detail page in order to replace your desired input values or validations with variables.

Trudon variables look like a regular text with embedded expressions. See the following examples:

  • {{username}}
  • My name is: {{first_name}} {{last_name}}

You can use variables in any step action or expectation, and you can combine any number of variables in a single step. You can use variables even in the starting URL for a test. See the following example below.

Create a data set source

A data set is a combination of scenarios and variables. To create a data set source, go to the data sets section, click the create button, provide a name for your data set, and select the project for it. A data set can be used only for tests within the same project.

Once the dataset is created, you can add any number of scenarios and variables you want. See an example below for a data set with four scenarios (File upload, Newsletter, Side navigation, and Bottom navigation) and three variables (page_url, page_title, next_page_title).

To change a scenario name, variable name, or variable value, click on the value, and it will automatically be converted into an input field that you can change.

Associate a test run with a data set

When you run a test or a test suite, check the Use data set checkbox, and select the appropriate data set on the settings tab. Basically, it will execute your test (or tests if you are running a whole test suite) for every single scenario (row in your data set).

If you select a data set with four scenarios and configure the run for two browsers, you will get 8 runs for every test. And thanks to Trudon’s scalable infrastructure, you can execute all of them in parallel!

Test results for data driven tests

You should be able to see the same type of results as you usually see when running regular tests. The only difference is that you have multiple test runs, according to the number of scenarios in your data set. See an example below.

Was this article helpful?
0 out Of 5 Stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
How can we improve this article?
Need help?