Data-driven test cases enable you to invoke the same test case multiple times, once for each data combination stored in a
data source. The data is passed to the test case as a parameter. You can think of a data-driven test case as a template for
a class of test cases. Data-driven test cases offer the following benefits:
- They reduce redundancy in a test plan.
- Writing a single test case for a group of similar test cases makes it easier to maintain scripts.
- They are reusable; adding new tests only requires adding new data.
Regardless of the technique you use, the basic process for creating a data-driven test case is:
- Create a standard test case. It will be very helpful to have a good idea of what you are going to test and how to perform
the verification.
- Identify the data in the test case and the
4Test data types needed to store this data.
- Modify the test case to use variables instead of hard data.
- Modify the test case to specify input arguments to be used to pass in the data. Replace the hard coded data in the test case
with variables.
- Call the test case and pass in the data, using one of four different techniques:
- Use a database and the
Data Driven Workflow to run the test case.
Micro Focus recommends using this method for data-driven testing.
- Click
and type the data into the
Run Testcase dialog box.
- In a QA Organizer test plan, insert the data as an attribute to a test description.
- If the data exists in an external file, write a function to read the file and use a
main() function to run the test case.