Before starting with data-driven testing is important to know which type of variable you are looking for, below are some articles that you might find useful.
If you’re looking for an explanation of how to define and use action, validation, or repository variables using the Ranorex Studio UI, go to Ranorex Studio advanced > Data-driven testing > Define variables
If you’re looking for an explanation of how to define and use module variables in code modules, go to
Ranorex Studio expert > Code modules > Module variables and data-driven testing
In data-driven testing, a test container (test case/smart folder) retrieves input values from a data source such as an Excel spreadsheet or a database file. The test container is then repeated automatically for each row of data in the data source.
The key components of a data-driven test are variables, data sources, and data binding. You’ll learn how to combine these to build a data-driven test in the following chapters. A sample solution and accompanying instructions will guide you through the process.
Parameters are another component of data-driven testing. They increase module reusability and make it possible to pass variable values from one recording module to another.
Data-driven testing also allows you to use conditions to further control test execution, which is why this topic is explained at the end of the data-driven testing chapter.
Download the sample solution
Except for the chapter on Conditions, each chapter in this section is dedicated to a separate part of building a data-driven test in Ranorex Studio and contains the necessary step-by-step instructions. Use the sample solution available below to put these instructions into practice. It comes with a prepared test suite and the required modules.
There is also a completed sample solution available in the chapter Run a data-driven test. It contains the finished project after all the steps in the chapters have been completed. You can use it as a reference.
Theme: Introduction to data-driven testing
Time: 30 minutes
Install the sample solution:
-
Unzip to any folder on your computer.
-
Start Ranorex Studio and open the solution file
RxSampleDataDrivenTesting.rxsln
The process of data-driven testing
To get you started, here’s a quick overview of how data-driven testing works:
A test case contains the recording modules that make up the test. The recording modules, in turn, contain the actions that are carried out during the test run and the repository items these actions are performed on.
These actions and repository items can be made variable and bound to an external data source that provides the test data. During the test run, these variables are then fed with the values from the data source. The test is driven by data; therefore, it is a “data-driven” test.
Like other actions, you can make validations variable as well. This allows you to verify whether the test data entered during a data-driven test produces the correct results in the AUT, i.e. if the actual result corresponds to the expected result. This is optional, but very useful. The sample solution that you will build in the following chapters includes a test-driven validation.
Recommended readings
To get the most from the examples in this chapter, we recommend a basic understanding of the material below