Forum Discussion

dust258's avatar
dust258
New Contributor
5 years ago
Solved

Table Checkpint in a Data-Driven Loop

I would like to convert one of my KeywordTests into a data driven loop. I added a loop using an Excel worksheed as Source which works fine. Inside the loop I need to create a Checkpoint to review t...
  • tristaanogre's avatar
    tristaanogre
    5 years ago

    Table checkpoints are tricky because you are comparing contents to contents of the WHOLE table all at once.  And the table that you have as a baseline is stored as an object in a collection.  So, you are talking about doing a checkpoint of a table that is dynamically changing each time through the loop against "static" objects.

    Now... the Table object itself DOES have Values properties that you can set dynamically through the test run.  You would need to write code to read the expected values out of some file and populate the values in the table object.  You're going to have to work with the properties available https://support.smartbear.com/testcomplete/docs/reference/project-objects/items/stores/table/values.html to first update your baseline with the expected values before you do the comparison.... and each time through the loop, you'll have to repeat this update.

    Rather than using the built in table checkpoint, I'd work on writing a custom Script routine to basically do the comparisons directly rather than using a checkpoint.

     

    Alternatively, you could create a baseline table corresponding to each time through the loop and then, using a code snippet, do an "eval" of the object, passing in the name as a variable.  But his feels clunky to me.