How to automate a grid belonging to ApexGrid in Te

2019-09-03 03:04发布

问题:

I have a grid in my application and I spied using the TestComplete tool. It identifies its WndClass as "TG60.ApexGrid32.20". I am not able to get the number of cells or rows properly. Anyone has any experience with objects of this class? Does any other application support this class? Any help would be greatly appreciated!

回答1:

I haven't used this grid but I guess it is a case of a virtual table.

virtual tables are built in runtime so you can't access the data by cells because the cells don't yet exist while you try reaching them.

what you need to do is scroll through the whole table and get all the rows by "scanning" the table.



回答2:

Your grid seems to be Apex True DBGrid (which later became ComponentOne True DBGrid). If not, update your question.

TestComplete doesn't support True DBGrid out of the box, but you can use the grid's native properties and methods for automation. For example, you can use the native Columns.Count property to get the number of columns.

Here're examples of automating True DBGrid using its native members:

Click cells

Click row indicators

To see what properties and methods you can use for automation, examine your grid in TestComplete's Object Browser. You can also check the True DBGrid documentation, but it applies to the latest True DBGrid version and may not apply to earlier versions.