How to invoke an application in QTP 9.2 using Scripting

Previous2122232425 2627282930Next

It is always easy in QTP 9.2 by just recording an playing back. Imagine to Invoke an application under test by writing some lines of code. Is isn’t interesting to run a script and launch the application.


For our case we will take the Flight Reservation Application and try to Invoke the application through the script so that the login screen of the Application is visible. We need to write these lines of code. We need to know the path of the Flight Application Executable file.

App_Path = "C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe"
InvokeApplication App_Path

If we run the script the login screen is displayed and if you run it n number of times that many no of login screens are displayed and you will be in a confusion state as to what screen should be used.


In order to make sure that even though the script is run any number of times it should only display one login screen. To do this we need to use IF Then conditional Statement. Amend the above script with these lines and now when you run the script any number of times only one Login screen is displayed.

If Not Dialog("Login").Exist(0) Then
App_Path = "C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe"
InvokeApplication App_Path
End If


Previous2122232425 2627282930Next

1 comments:

Unknown said...

nioce posts...
Hadoop training in hyderabad.All the basic and get the full knowledge of hadoop.Hadoop online training
With the technological advancements professionals and learners need to keep themselves updated and match the pace. For an example, sorting and tracking Big Data requires enough skilled man power.


Post a Comment

/* Tynt Insight tracker ----------------------------------------------- */