Highlight an object or window using QTP

To highlight an object or window manually or programmatically (from within the script)


Object Repository window. Available also in the Object Repository Manager for shared object repositories:
1. Open the Object Repository

2. Select desired object to highlight

3. Go to "View" menu

4. Select "Highlight in application" option

5. See results:
◦ Succesful: Blinking gray rectangle surrounding the object

◦ Failed: A pop-up window with an error or warning.

Object Spy. Available in QuickTest Professional 11.00, Unified Functional Testing 11.5 and later):
1. Open the Object Spy dialog

2. Click on the spy button

3. Click/Select desired object or child of desired object

4. Select desired object from the Hierarchical tree pane

5. Click the "Highlight in application" option, next to "Spy" button

6. See results (Exact same as when using similar option from Object Repository section above)


Call/Invoke/Use the hidden/undocumented programmatic Highlight method.


Where "Object" is a Test Object class.

description – The logical name or a descriptive programming description of the object or window to be highlighted.


wait 1
Browser("Netscape.com").Page("Netscape.com").Link("Breaking News:").highlight
wait 1
Browser("Netscape.com").Page("Netscape.com").Image("Get Quote").highlight

‘ or

wait 1
wait 1

Leave a Comment