Micro Focus QTP (UFT) Forums

Full Version: QTP launch error
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi
Am not able to launch QTP using the script as after runing the below mentioned code through a vbs file, QTP appears for a flash of a second and then it disappears.

CODE ::
---------------------------------------------------------------
Code:
Set App = CreateObject("QuickTest.Application")
App.Launch
App.Visible = True
App.WindowState = "Maximized" ' Maximize the QuickTest window
App.ActivateView "ExpertView" ' Display the Expert View
---------------------------------------------------------------

qtp process exists in the "Processes" tab of the task manager but it does not appears in the "Applcations" tab.

Am using QTP 10.0 and Windows 7

please suggest . . . .

thanks
HimsSmile
Add below code before launching QTP and try...

Code:
call fn_CloseApplication( “QTPro.exe”)
call fn_CloseApplication( “QTAutomationAgent.exe”)

Public Function  fn_CloseApplication( byval sApplicationExe)
Dim strComputer
Dim objWMIService
Dim colProcesses
Dim objProcess
strComputer = “.”
Set objWMIService = GetObject(“winmgmts:\\” & strComputer & “\root\cimv2″)

Set colProcesses = objWMIService.ExecQuery (“Select * from Win32_Process Where Name = ‘”&sApplicationExe&”‘”)
For Each objProcess in colProcesses
objProcess.Terminate()
Next
Set objWMIService = Nothing
Set colProcesses=Nothing
End Function
Hi vIns . .. thanx a lot fr suggesting a solution . . . . but it seems to be not helpful as even implementing the code suggested by you, am facing the same kind of response.

What actually happening is like I was making it sure that no qtp process is already running in background before running the above mentioned launch script even before u provided the code to kill the processes. When I execute the said script, qtp gets initialized, it appears for a fraction of a second and then disappears. After that, its instance appears in the task manager's processes tab.

The above mentioned code is wrking fine on other machines. I doubt, is this issue is OS specific or firewall or any other thing if u can suggest . . . . ??

I wud b a great favor if u can take a bit more pain in resolving the above problem . . . . .

thnx
Hims . . . . Smile
Hi,

I am facing same problem.If you know the reason/solution please send across to me.

Thank u in advance.