how do close the task manager through QTP?

Answers were Sorted based on User's Feedback



how do close the task manager through QTP?..

Answer / deven mehta

First you should add the Task Manager dialog box in the
object repository. This is not a modal dialog box so you
can add it to repository easily.Then use following simple
code.

If Dialog("Windows Task Manager").Exist Then
Dialog("Windows Task Manager").Close
Reporter.ReportEvent micPass "Task Manager" "Successfully
closed task
manager"
Else
Reporter.ReportEvent micFail "Task Manager" "Task Manager
is not open"
End If

Is This Answer Correct ?    1 Yes 0 No

how do close the task manager through QTP?..

Answer / rajni singh

Ucan use below function to kill excel object from task
manager:

'===========================================================
====================
Sub KillExcel ()

strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer
& "\root\cimv2")

Set colProcesses = objWMIService.ExecQuery ("Select * from
Win32_Process Where Name ='Excel.exe'")

For Each objProcess in colProcesses

objProcess.Terminate()

Next

End Sub
'===========================================================
=====================
call KillExcel()

Is This Answer Correct ?    1 Yes 2 No

Post New Answer

More QTP Interview Questions

I am testing a website TheLancet in qtp 9.2 and running a script but its not working.Tell me if m doing anything wrong in the script. If Browser("TheLancet.com - Home Page").Page("TheLancet.com - Home Page").Link("Clinical").exists then msgbox "object exist" Else msgbox"object doesnt exist"

2 Answers   Rolta,


Create flight reservation login descriptive programing (Condition: Remove the value and substitute with a variable, and then call the validation from Excel) Plz help me....... very urgent.........

0 Answers  


What is the difference between "Call to copy of action", "Call to existing action" & "Call to winrunner action"?

5 Answers  


I heard that in Hyderabad Ameerpet is renowned for its training institutes it has , but from my own experience I can only say that this institutes have become money making machines losing their cognitive ability and ethics , can anybody tell me is there a good ins. in hyderabad for testing tools.?

2 Answers  


What is clean sweep?

0 Answers  






write script for "dropdown button having how many words? for ex.SELECT CITY is dropdown name.. find out how many cities in that?

1 Answers  


what is the use of VIRTUAL OBJECTS? explain ?

10 Answers   ABC Infotech, IBM, TCS,


How to check the value for variables during run time. Pls anybody can give the answer.. Thanks in advance...

4 Answers   Navis,


anyone can explain about "Smart Identification" in QTP. what is the use of "Smart Identification" ???

1 Answers  


what is the latest version of QTP? Main difference between 9.2 and 10 version

0 Answers  


Explain synchronization types in QTP

2 Answers  


Maximum synchronizing time out in QTP

3 Answers   Kanbay,


Categories