Search code examples
qtphp-uft

Identify all properties of an object when recording in UFT


I'm looking for a way to save all the object properties of every object I click when recording an UFT test. The basic idea is to override the function that captures the property when recording it and make it dump all properties into an excel.

Is something like that already available or do you have any idea how I can proceed this?


Solution

  • 1. You could reconfigure UFT's object configuration ("Tools"/"Object configuration") so that for all the test object classes you are interested in, all available properties are mandatory properties. (To persist changes done in that dialog, use the "Generate script..." button, and execute the resulting script before starting a recording session.)

    To export to Excel, you could export the resulting OR to XML, and transform that into an importable form. This might be quite complex since the OR XML schema is not exactly trivial.

    2. Alternatively, you could create custom object test classes using Extensibility, and customize it so it a) defines all the TO properties to be mandatory and b) writes the "learned" properties to an Excel-compatible format during recording. Extensibility lets you do a) and b), but the overhead of getting an Extensibility setup up and running is not low.

    3. Finally, you could write a "Dump dialog" script that enumerates all GUI objects of a dialog as test objects, and writes the collection returned by getTOProperties to an Excel-compatible file. However, how would you enumerate the objects? If you use .ChildObjects, you get a strongly simplified hierarchy. If you use DOM, you are IE-specific. If it is a Java app, you´ll need to stick to .ChildObjects, or use the native Java API (through .Object).

    Most importantly, it would be much more interesting to know why you would want to dump all GUI objects' TO property values to Excel to begin with. I doubt your goal is worth the trouble, and effort, involved in achieving this.