Saturday, 5 February 2011

QTP @ Synchronization Methods

Leave a Comment
Read More...

QTP @ Ways to synchronize the test

Leave a Comment
Read More...

QTP @ Synchronization @ Script Demo

Leave a Comment


QTP @ Synchronization @ Script Demo 

'*******************************************
'QTP @ Synchronization @ Script Demo
'*******************************************

'********************************************
'QTP @ Synchronization > Wait Method Demo
'********************************************
SystemUtil.Run "C:\Program Files\HP\QuickTest Professional\samples\flight\app\flight4a.exe"
wait(2)

'********************************************
'QTP @ Synchronization > WaitProperty Method Demo
'********************************************
LoginExist=Dialog("Login").WaitProperty("enabled",10): msgbox "LoginExist" & LoginExist

'********************************************
'QTP @ Synchronization > Exist Method Demo
'********************************************
If Dialog("Login").Exist Then
Dialog("Login").Activate
Dialog("Login").WinEdit("Agent Name:").Set "QuickTest"
Dialog("Login").WinEdit("Agent Name:").Type  micTab
Dialog("Login").WinEdit("Password:").SetSecure "4cff4da856c61fe63bc04099938e4b492de78365"
Dialog("Login").WinButton("OK").Click
wait(5)
'********************************************
'QTP @ Synchronization > WaitProperty Method Demo
'********************************************
st1=Window("Flight Reservation").WaitProperty ("visible",true,1500000)
MsgBox st1
Window("Flight Reservation").WinMenu("Menu").Select "File;Exit"
else
MsgBox " Nothing I can do here"

End If


Read More...

QTP @ Synchronization

Leave a Comment
QTP @ Synchronization

Synchronization:

Synchronizing is the process of utilizing time lines / time periods until for a specific purpose

When you run tests, your application may not always respond with the same speed.
For example, it might take a few seconds:
  •       For a progress bar to reach 100%
  •       For a button to become enabled
  •       For a button to become disabled
  •       For a window or pop-up message to open
  •  
You can handle these anticipated timing problems by synchronizing your test to ensure that QuickTest waits until your application is ready before performing a certain step

Synchronization - Ways to synchronize the test

There are several options that you can use to synchronize your test:
  We can insert a synchronization point, which instructs
    QuickTest to pause the test until an object property achieves the value you specify. QTP -> Insert > Synchronization Point
  We can use Sync method to utilize the synchronization until for a specific time
  We can insert Exist statements that instruct QuickTest to wait until an object exists
  We can use Wait to wait a specified amount of time before continuing the test.
  You can also use Waitproperty(“propertyname”)
  You can also increase the default Timeout settings in the Test Settings and Options dialog boxes in order to instruct QuickTest to allow more time for certain events to occur.
  QTP -> File > Settings > Run > Synchronization timeout

Synchronization – Methods

Wait(WaitTime)
Wait(10)
WaitProperty “PropertyName”,”PropertyValue”, Time
Dialog("Login").WaitProperty "enabled",true,10
Exist
If Dialog("Login").Exist Then
Dialog("Login").Close
End If
Sync
Browser("Welcome: Mercury Tours").Page("Page").Sync
Read More...

QTP @ SetTOProperty Script Demo

Leave a Comment
Read More...

QTP @ GetTOProperty Script Demo

Leave a Comment
Read More...

QTP @ GetTOProperties Script Demo

Leave a Comment
Read More...

Saturday, 5 February 2011

QTP @ Synchronization Methods

QTP @ Ways to synchronize the test

QTP @ Synchronization @ Script Demo



QTP @ Synchronization @ Script Demo 

'*******************************************
'QTP @ Synchronization @ Script Demo
'*******************************************

'********************************************
'QTP @ Synchronization > Wait Method Demo
'********************************************
SystemUtil.Run "C:\Program Files\HP\QuickTest Professional\samples\flight\app\flight4a.exe"
wait(2)

'********************************************
'QTP @ Synchronization > WaitProperty Method Demo
'********************************************
LoginExist=Dialog("Login").WaitProperty("enabled",10): msgbox "LoginExist" & LoginExist

'********************************************
'QTP @ Synchronization > Exist Method Demo
'********************************************
If Dialog("Login").Exist Then
Dialog("Login").Activate
Dialog("Login").WinEdit("Agent Name:").Set "QuickTest"
Dialog("Login").WinEdit("Agent Name:").Type  micTab
Dialog("Login").WinEdit("Password:").SetSecure "4cff4da856c61fe63bc04099938e4b492de78365"
Dialog("Login").WinButton("OK").Click
wait(5)
'********************************************
'QTP @ Synchronization > WaitProperty Method Demo
'********************************************
st1=Window("Flight Reservation").WaitProperty ("visible",true,1500000)
MsgBox st1
Window("Flight Reservation").WinMenu("Menu").Select "File;Exit"
else
MsgBox " Nothing I can do here"

End If


QTP @ Synchronization

QTP @ Synchronization

Synchronization:

Synchronizing is the process of utilizing time lines / time periods until for a specific purpose

When you run tests, your application may not always respond with the same speed.
For example, it might take a few seconds:
  •       For a progress bar to reach 100%
  •       For a button to become enabled
  •       For a button to become disabled
  •       For a window or pop-up message to open
  •  
You can handle these anticipated timing problems by synchronizing your test to ensure that QuickTest waits until your application is ready before performing a certain step

Synchronization - Ways to synchronize the test

There are several options that you can use to synchronize your test:
  We can insert a synchronization point, which instructs
    QuickTest to pause the test until an object property achieves the value you specify. QTP -> Insert > Synchronization Point
  We can use Sync method to utilize the synchronization until for a specific time
  We can insert Exist statements that instruct QuickTest to wait until an object exists
  We can use Wait to wait a specified amount of time before continuing the test.
  You can also use Waitproperty(“propertyname”)
  You can also increase the default Timeout settings in the Test Settings and Options dialog boxes in order to instruct QuickTest to allow more time for certain events to occur.
  QTP -> File > Settings > Run > Synchronization timeout

Synchronization – Methods

Wait(WaitTime)
Wait(10)
WaitProperty “PropertyName”,”PropertyValue”, Time
Dialog("Login").WaitProperty "enabled",true,10
Exist
If Dialog("Login").Exist Then
Dialog("Login").Close
End If
Sync
Browser("Welcome: Mercury Tours").Page("Page").Sync

QTP @ SetTOProperty Script Demo

QTP @ GetTOProperty Script Demo

QTP @ GetTOProperties Script Demo