Monday, 10 March 2014

QTP Synchronization

E x1: 'Exist Property for Synchronization SystemUtil.Run "C:\Program Files\HP\QuickTest Professional\samples\flight\app\flight4a.e... thumbnail 1 summary
Ex1:

'Exist Property for Synchronization


SystemUtil.Run "C:\Program Files\HP\QuickTest Professional\samples\flight\app\flight4a.exe","","C:\Program Files\HP\QuickTest Professional\samples\flight\app\","open"


Dialog("Login").Activate

Dialog("Login").WinEdit("Agent Name:").Set "asdf"
Dialog("Login").WinEdit("Password:").SetSecure "4ec473345f54155ecd0b74c636319eac15680767"
Dialog("Login").WinButton("OK").Click

If Window("Flight Reservation").Exist(10) Then


Window("Flight Reservation").Activate

Window("Flight Reservation").WinButton("Button_2").Click
Window("Flight Reservation").Dialog("Open Order").WinCheckBox("Order No.").Set "ON"
Window("Flight Reservation").Dialog("Open Order").WinEdit("Edit").Set "1"
Window("Flight Reservation").Dialog("Open Order").WinButton("OK").Click

End If


Ex2:

Where synchronization used in the real time:

-------------------------------------------------------

Window("Flight Reservation").Activate
Window("Flight Reservation").WinMenu("Menu").Select "File;Open Order..."
Window("Flight Reservation").Dialog("Open Order").WinCheckBox("Order No.").Set "ON"
Window("Flight Reservation").Dialog("Open Order").WinEdit("Edit").Set "4"
Window("Flight Reservation").Dialog("Open Order").WinButton("OK").Click
Window("Flight Reservation").WinEdit("Name:").Set "Jon Baker"
Window("Flight Reservation").WinButton("Update Order").Click

wait(3)
Window("Flight Reservation").WinMenu("Menu").Select "File;Open Order..."
Window("Flight Reservation").Dialog("Open Order").WinCheckBox("Order No.").Set "ON"
Window("Flight Reservation").Dialog("Open Order").WinEdit("Edit").Set "2"
Window("Flight Reservation").Dialog("Open Order").WinButton("OK").Click
Window("Flight Reservation").WinButton("Button").Click

Note: for trail example purpose modify the tool -> settings -> run->timeout:05 seconds
      but it is not taken 5 seconds at eighth step, becuase prograss bar operation 3 more seconds to complete the operation.
      so here upto that file menu was not enabled. that's why required here 3 more seconds to enable the file menu.
      now put 8 seconds (5+3) time out in tool --> settings. Now it completes the operation.
      now execute the 8th statement operation successfully.

Ex3:


sync:

Window("Flight Reservation").WinMenu("Menu").Select "File;Open Order..."
Window("Flight Reservation").Dialog("Open Order").WinCheckBox("Order No.").Set "ON"
Window("Flight Reservation").Dialog("Open Order").WinEdit("Edit").Set "4"
Window("Flight Reservation").Dialog("Open Order").WinButton("OK").Click

Window("Flight Reservation").WinButton("Update Order").Click

Window("Flight Reservation").WinObject("Update Done").WaitProperty "text", "Update Done...", 3000

Window("Flight Reservation").WinMenu("Menu").Select "File;Open Order..."
Window("Flight Reservation").Dialog("Open Order").WinCheckBox("Order No.").Set "ON"
Window("Flight Reservation").Dialog("Open Order").WinEdit("Edit").Set "2"
Window("Flight Reservation").Dialog("Open Order").WinButton("OK").Click

Window("Flight Reservation").WinButton("Button").Click







Window("Flight Reservation").WinMenu("Menu").Select "File;Open Order..."
Window("Flight Reservation").Dialog("Open Order").WinCheckBox("Order No.").Set "ON"
Window("Flight Reservation").Dialog("Open Order").WinEdit("Edit").Set "4"
Window("Flight Reservation").Dialog("Open Order").WinButton("OK").Click

Window("Flight Reservation").WinButton("Update Order").Click
wait(4)

Window("Flight Reservation").WinMenu("Menu").Select "File;Open Order..."
Window("Flight Reservation").Dialog("Open Order").WinCheckBox("Order No.").Set "ON"
Window("Flight Reservation").Dialog("Open Order").WinEdit("Edit").Set "2"
Window("Flight Reservation").Dialog("Open Order").WinButton("OK").Click

Window("Flight Reservation").WinButton("Button").Click


==================================

No comments

Post a Comment