Allow other HP products to interact option in QTP and Launch QC explorer


 Here is the code to set "Allow other HP products" option to true before starting automation.

Set objWshShell = CreateObject("WScript.Shell")
Set objApp = createObject("QuickTest.Application")
objWshShell.RegRead("HKEY_CURRENT_USER\Software\Mercury Interactive\QuickTest Professional\MicTest\")
        If Err <> 0 Then
            Wscript.Sleep 1000
            objApp.Launch
            objApp.Visible = False
            objApp.Options.Run.RunMode = "Fast"
            objApp.Quit
        End If
        objWshShell.RegWrite "HKEY_CURRENT_USER\Software\Mercury Interactive\QuickTest Professional\MicTest\AllowTDConnect","1","REG_DWORD"

'------------------
' Launches QC Explorer
'------------------
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists ("C:\Program Files\Common Files\HP\QCExplorer\QCExplorer.exe") Then
            objWshShell.run "cmd /K CD C:\Program Files\Common Files\HP\QCExplorer\ & QCExplorer.exe http://
qc.com/qcbin/start_a.htm" 
ElseIf objFSO.FileExists ("C:\Program Files (x86)\Common Files\HP\QCExplorer\QCExplorer.exe") Then
            objWshShell.run "cmd /K CD C:\Program Files (x86)\Common Files\HP\QCExplorer\ & QCExplorer.exe http://qc.com/qcbin/start_a.htm"
Else
      Msgbox "QC Explorer not launched as .exe file not found"
End If



Happy Testing!

Comments

Popular posts from this blog

XPATH for IE / internet explorer

Website's underlying technology for automation

All time good software testing books!