Data-Driven Test Cases

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:

Regardless of the technique you use, the basic process for creating a data-driven test case is:

  1. 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.
  2. Identify the data in the test case and the 4Test data types needed to store this data.
  3. Modify the test case to use variables instead of hard data.
  4. 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.
  5. 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 Run > Testcase 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.