Forum Discussion

tgrubb's avatar
New Contributor
13 years ago

Automated Way to Determine Complete Coverage of GUI Elements?

Is there an automated way to determine if our TestComplete Keyword/script tests have "touched" every GUI control?  We have a very large application with many panels with many controls.  It would be *very* helpful if there was a way at the end of a project to call some function to determine if our tests had at least touched every control.  Is there such a function?  If not that, is there a way to print a list of all the controls on a panel (including ones not specifically enumerated in the namemapping)?



1 Reply

  • Hi Thomas,

    There is no direct way to do this. However, there are two possible approaches which can help you achieve similar functionality:

    1. Use coverage profiling. This is the commonly used approach when it's necessary to detect the amount of code being executed during a test. For example, you can use our profiling tool, AQtime, to get information on how many code lines have been executed in the tested application during a test. Additional information on AQtime can be found on the following page:

    2. Enumerate objects in each container via the Child method (see the Child Method and ChildCount Property help topics for more information) and check the MappedName property of the objects. If the property is empty, an object is not mapped and, therefore, is not likely to be clicked in your test (unless you address objects via full names or use the FindChild method to retrieve them). This, however, is not a very reliable approach - it does not allow collecting run-time data on which objects were actually clicked, it just provides you with a rough estimate of how many objects are involved in your tests. Note that you'll also probably need to filter out objects which cannot be clicked. That is, objects which have zero width and/or height, disabled objects, invisible objects, objects having a specific WndClass (e.g. labels), etc.