Forum Discussion

JP_603's avatar
JP_603
Occasional Contributor
9 years ago
Solved

Data Drive testing over test sequence

Is it possible to do a data driven test over a sequence of tests? By that I mean can one row of a csv file be used to go through each test in the sequence using the data in each test and then loop ba...
  • Colin_McCrae's avatar
    9 years ago

    Yes.

     

    I do pretty much exactly this using Excel via COM.

     

    I don't use the in-built DDT object as I found it too limiting for what I wanted. I have my own set of custom script extensions that act as a framework and work through lists of tests/test steps/test data contained in one or more Excel sheets.

     

    Each line on the spreadsheet contains:

     

    A run flag (ie - run this line or not)

    A timestamp (which will be filled in as and when the line is run)

    A result (which will be filled in as and when the line is run)

    The name of the test function to call. (All functions in use must be known - ie. USEUNIT - to the "driver" function that controls all this)

    A number of parameters (data) to pass into the function. Can to zero to many.

    A number of expected results (data) for the function to check against. Can be zero to many.

    (Optional) A reference to a data file if there is too much data for a single Excel cell. If present, file will be read and the data passed to the function/test.

    (Optional) A marker. Can be referred to by susequent lines to check if a prior test/step passed to failed.

    (Optional) A lookup. Checks the status of a marker line (see above) to determine whether a line should be run or not based on the result of the lookup.

     

    This all produces an output/results sheet. (There is also an associated log file which writes out in far more detail exactly what the test is doing.)

     

    Once all tests are run, it then collates a summary results sheet of all tests. This is saved along with the individual results. It can also (optionally - it's a config setting) be mailed to specific mailing list and also write out an HTML summary which can be accessed via the build page or internally via our intranet.

     

    These are all custome build script extension functions to the TestComplete IDE. They form our testing framework. All you then need to do is write and docuement new functions as required. And then use those as and where required by filling in the test details on spreadsheet(s).