Thursday, 21 July 2011

Vb Script for How to Stop QTP while an Error Occurred?

'open QTP
qtapp()
Function qtapp()
   Set qtapp=Createobject("QuickTest.Application")
   qtapp.launch
   qtapp.visible=True
End Function

'Open Application
app()
Function app()
SystemUtil.Run "flight4a.exe","","C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\","Open"
End Function

'Open Login window
login()
Function login()
  Set qapp=qtapp.Test
 Dialog("Login").WinEdit("Agent Name:").Set "velmurugan"
   Dialog("Login").WinEdit("Password1:").SetSecure "krishnan"
   Dialog("Login").WinButton("OK").Click
      qapp.Settings.Run.OnError="Stop" 'its for Stop appliction 
Window("Flight Reservation").Close
End Function

No comments:

Post a Comment