07-25-2010, 01:36 AM
Hi
Friends
This is Shiva
I have an issue of launch script for launching QTP application.
I want to write code for the application if it is open it should be closed and if it is closed it should be opened.
Please help me to solve this problem
Thanks in advance
1. This is the code to launch the QTP Application
It is working
2. This is the code to close the qtp application
It is working
But when we are giving the condition for launch and close in the single file it is not working
what is the solution ?
Friends
This is Shiva
I have an issue of launch script for launching QTP application.
I want to write code for the application if it is open it should be closed and if it is closed it should be opened.
Please help me to solve this problem
Thanks in advance
1. This is the code to launch the QTP Application
Code:
Dim qtp_app
Set qtp_app = CreateObject("quicktest.application")
If qtp_app.launch = false Then
qtp_app.quit
qtp_app.launch
qtp_app.new
qtp_app.visible=true
End if
2. This is the code to close the qtp application
Code:
Dim qtp_app
Set qtp_app = CreateObject("quicktest.application")
If qtp_app.visible = true Then
qtp_app.quit
Set qtp_app=nothing
End if
But when we are giving the condition for launch and close in the single file it is not working
Code:
Dim qtp_app
Set qtp_app = CreateObject("quicktest.application")
If qtp_app.visible = true Then
qtp_app.quit
Set qtp_app=nothing
End if
If qtp_app.launch = false Then
qtp_app.quit
qtp_app.launch
qtp_app.new
qtp_app.visible=true
End if
what is the solution ?