Quality Testing

Quality is delighting customers

I am practicing on Flight Reservation app.

  • I kept the 3 sets of data(Uname and pwd) in data table
  • Generate basic script
  • first of all i invoke the flight application by using Invokeapplication
  • It can also be done by using Systemutility.Run  
  • i use On error resume next for performing error handling,
  • Then I parametarise the Uname and pwd constatns by manually.
  • It can be done in other ways as Keyword view as well as data driver
  • And I use Utility Statement Reporter.reportevent to get userfriendly resultin result window

Script I prepared is...

1.On Error Resume Next

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

3.If Dialog("Login").Exist(2) Then   

4.Dialog("Login").WinEdit("Agent Name:").Set DataTable("uname", dtGlobalSheet)   5.Dialog("Login").WinEdit("Password:").Set DataTable("pwd", dtGlobalSheet)   6.Dialog("Login").WinButton("OK").Click   

7.Reporter.ReportEvent micPass,"Login","Login done succefully..."If Window("Flight               Reservation").Exist(6) Then   

8.Window("Flight Reservation").Close   

9.Reporter.ReportEvent micPass,"Flight Window","Flight Window Succefully closed.."

10.Else  

11.Reporter.ReportEvent micFail,"Flight Window","Flight window does not exist.."

12.End If

13.Else   

14.Reporter.ReportEvent micFail,"Login","Login failed..."End If

15.If err.number <> 0 Then print "Error number is ...." & err.number & "      And Error description         is" & err.description else print "No error occured..."

16.End If

 

Views: 307

Reply to This

Replies to This Discussion

While Debugging the above code ,I got a problem at line number 3.

Exist Statement Wont allow for debugging....Is it true?

Please share your valuable thoughts....

RSS

TTWT Magazine


Advertisement

Advertisement

Advertisement

Advertisement

© 2020   Created by Quality Testing.   Powered by

Badges  |  Report an Issue  |  Terms of Service