Micro Focus QTP (UFT) Forums
How to change "wait time" in conditional statement If - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: How to change "wait time" in conditional statement If (/Thread-How-to-change-wait-time-in-conditional-statement-If)



How to change "wait time" in conditional statement If - Kacper - 02-11-2008

Hi,
I use in expert view syntax expression like

Code:
IF JavaWindow.(...).JavaButton("Accept").Exist Than
(...)
End If

and when i run test (in fast mode) i have to wait 10 sec for each IF inside my path.

Is there possibility to improve it ? give it just few secounds to wait?

best regards


answer Wrote:VirtualButton.Exist([Timeout])
u can grab more info in help at exist Method in VButton object



RE: How to change "wait time" in conditional statement If - Rajashekar Gouda - 02-22-2008

Just before If statement you can use
Setting("DefaultTimeout") = 1000 where 1000 is in milliseconds.
this will make the default timeout for the object to the no you have specified (in italics).


Regards
Raj


RE: How to change "wait time" in conditional statement If - FredMan - 02-29-2008

You need to put the time to wait in parenthesis, .Exist(2), so that the statement will wait for that time in seconds. If you leave this blank, QTP will wait for the default 20 seconds. So:
Code:
IF JavaWindow.(...).JavaButton("Accept").[b]Exist [/b]Than
(...)
End If

Code:
Should be
IF JavaWindow.(...).JavaButton("Accept").[b]Exist(2)[/b] Then
(...)
End If