07-26-2010, 12:48 AM
Hi Vinay,
Here we go !!!
Check the below code for both conditions i.e Launching and Closing QTP by using single file/script.
Condition1: If we execute this script, if Launch=False and if QTP is Visible then it will closes QTP.
Condition2: If we execute the same script, if Launch=False and Not Visible then it would launch QTP.
Here we go !!!
Check the below code for both conditions i.e Launching and Closing QTP by using single file/script.
Condition1: If we execute this script, if Launch=False and if QTP is Visible then it will closes QTP.
Condition2: If we execute the same script, if Launch=False and Not Visible then it would launch QTP.
Code:
Dim qtp_app
Set qtp_app = CreateObject("quicktest.application")
If (qtp_app.Launch=False) And (qtp_app.visible=True) Then
qtp_app.quit
Else
If (qtp_app.Launch=False) And (qtp_app.visible=False) Then
qtp_app.launch
qtp_app.visible=True
End if
End if
Set qtp_app=Nothing