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


Download run results files from ALM using OTA

This can be done using the ExtendedStorage property of the Run object.

Note: it works for both normal tests and BPT tests

RunID = 433
downloadPath = “C:\Temp”
qcurl = “
qcdomain = “DEFAULT”
qcproject = “DemoProject”
qcuser = “admin”
qcpass = “”

if IsOTAInstalled() then
set QCConnection = CreateObject(“TDApiOle80.TDConnection”)
QCConnection.InitConnectionEx qcurl
QCConnection.ConnectProjectEx qcdomain, qcproject, qcuser, qcpass
If not QCConnection.Connected then
Msgbox “Not connected. Exiting…”
Set auxFilter = tdc.RunFactory.Filter
auxFilter.Filter(“RN_RUN_ID”) = RunID
For Each auxRun In auxFilter.newlist
Set extStorage = auxRun.ExtendedStorage
extStorage.ClientPath = downloadPath & “\” & RunID
extStorage.Load “”, true
End if
Msgbox “OTAClient.dll not registered. Exiting…”
End if
Function IsOTAInstalled()
IsOTAInstalled = true
On Error Resume Next
set QCConnection = CreateObject(“TDApiOle80.TDConnection”)
if err.number <> 0 then IsOTAInstalled = false
On error goto 0
End Function