Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Alternative for Wait Statement
#1
Solved: 10 Years, 8 Months, 3 Weeks ago Exclamation 
Hi,

My Web application sometimes takes 30 seconds to load a page and sometimes its 50 seconds and more.

so while using Wait(30) it fails sometimes and if i use more time..i have to wait till its completed..

Is there any other alternative statement for WAIT, so that once it is completed, QTP will move to the next execution ?

Thanks in Advance
Vijay
Reply
#2
Solved: 10 Years, 8 Months, 3 Weeks ago
use waitproperty method.
This method is useful for test run synchronization. Unlike the Exist ro wait methods, the WaitProperty method enables you to synchronize the test run based on a specific object property. For example, you can instruct QuickTest to wait for a particular string to appear in a static text control:
' Wait up to 30 seconds for the string "Ready" to appear in the "Status" text control.
Window("Test").Static("Status:").WaitProperty "text", "Ready", 30000
Reply
#3
Solved: 10 Years, 8 Months, 3 Weeks ago
Hi vijay,

sync method: Waits for the browser to complete current navigation.

Code:
'Wait till Gmail browser launches
Browser("title:=Gmail: Email from Google").Sync

Exist statement:We can enter Exist statements to instruct QuickTest to wait for a window to open or an object to appear. Exist statements return a boolean value indicating whether or not an object currently exists.

Code:
'Wait till Gmail browser exists
Do while  
Browser("title:=Gmail: Email from Google").Exist(1) = False  
Wait 1
Loop

Wait Property method:wait until the specified object property value=expected value
Code:
Browser("Yahoo! Mail: The best").Page("Yahoo! Mail: The best").WebEdit("login").WaitProperty "Value", "Inbox", 3000
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  help with wait property function kp_usa 3 3,972 12-20-2012, 10:49 PM
Last Post: kp_usa
  wait QAVA 1 2,773 11-13-2012, 07:29 PM
Last Post: imzeeshan
  How to control WAIT time with STATIC variable? chong67 3 3,809 06-22-2012, 10:38 AM
Last Post: sshukla12
  Verifying the value exists and if not, wait up to 5min HeZma 3 3,828 02-25-2012, 12:21 PM
Last Post: rajpes
  How to Handle Browser page wait In Firefox QTP V11. UFTEnthusiast 0 3,458 05-30-2011, 05:25 PM
Last Post: UFTEnthusiast

Forum Jump:


Users browsing this thread: 1 Guest(s)