Forum Discussion
- tristaanogreEsteemed Contributor
No, there is not. The "Tables" objects is how you interact with Tables in script code and keyword tests. Unfortunately, this object has no methods or properties on it to add them dynamically.
This is one of the primary disadvantages to checkpoints in TC with one exception: that you need to create your baselines for comparison manually rather than dynamically in script. The exception is the "Objects"... you can add those dynamically in script using the Objects.Add method to add an onscreen object and it's properties to the Objects stores.
Is there a reason why you need to do this via script? It seems that, if you have the data in your Excel, you already have your baseline. Write code to iterate through the onscreen table and compare it to rows and columns in your excel spreadsheet to compare values. No need to have them as "tables" in TestComplete... Excel, essentially, acts as your tables.- pkimmelOccasional Contributor
Robert,
Thanks for the information. Only the settings are stored in the excel file. The program being tested uses each setting to generate a table that I want to use for comparison. Since the regression test I want to create would use 288 tables, I would prefer to generate the stored table automatically rather than using the wizard 288 times during the first run of the test.
I suppose I could store the tables as tabs in a spreadsheet but that seems like reinventing TestComplete stored tables.
Do you see any way of using the Objects Add method to store a screen object such as a data grid in Objects stores, give it a unique identifier, and then use it for the comparisons?
Thanks
- tristaanogreEsteemed Contributor
Yes, Objects.Add will take any onscreen object and store it with whatever properties you designate. See https://support.smartbear.com/testcomplete/docs/reference/project-objects/items/stores/add.html