Pages

Saturday, November 27, 2010

Random Numbers in Flight Application

STEP1: Record a session on Flight Reservation for insert new order.the  recorded script is as follows


Window("Flight Reservation").Activate
Window("Flight Reservation").WinMenu("Menu").Select "File;New Order"
Window("Flight Reservation").ActiveX("MaskEdBox").Type "121210"
Window("Flight Reservation").WinComboBox("Fly From:").Select "Zurich"
Window("Flight Reservation").WinComboBox("Fly To:").Select "London"
Window("Flight Reservation").WinButton("FLIGHT").Click
Window("Flight Reservation").Dialog("Flights Table").WinButton("OK").Click
Window("Flight Reservation").WinEdit("Name:").Set "swarupa"
Window("Flight Reservation").WinButton("Insert Order").Click

Step 2: Apply the Concept of Random number to Fly_From and Fly_To as follows


Window("Flight Reservation").Activate
Window("Flight Reservation").WinMenu("Menu").Select "File;New Order"
Window("Flight Reservation").ActiveX("MaskEdBox").Type "121210"
Window("Flight Reservation").WinComboBox("Fly From:").Select RandomNumber.Value(0,9)
Window("Flight Reservation").WinComboBox("Fly To:").Select Randomnumber.Value(0,9)
Window("Flight Reservation").WinButton("FLIGHT").Click
Window("Flight Reservation").Dialog("Flights Table").WinButton("OK").Click
Window("Flight Reservation").WinEdit("Name:").Set "sweeya"
Window("Flight Reservation").WinButton("Insert Order").Click

Note : as there are 10 values in the combo-box  i have given the values for Random numbers as 0 for lowest interval and 9 for the highest value

Step 3: Now RUN the test you can see the application takes Random values for Fly_From and Fly_To every time we execute the script

No comments:

Post a Comment