Micro Focus QTP (UFT) Forums
QTP launch error - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: QTP launch error (/Thread-QTP-launch-error)



QTP launch error - himanshu1178 - 12-27-2011

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



RE: QTP launch error - vIns - 12-28-2011

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



RE: QTP launch error - himanshu1178 - 12-29-2011

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


RE: QTP launch error - sowmya - 02-13-2012

Hi,

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

Thank u in advance.