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!

0 comments:
Post a Comment