Micro Focus QTP (UFT) Forums
wait statements - 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 Others (https://www.learnqtp.com/forums/Forum-UFT-QTP-Others)
+--- Thread: wait statements (/Thread-wait-statements)



wait statements - sunny rao - 07-31-2008

Hi,

I am trying to automate a .NET and VB based application.
Instead of wait(15) before a VB window appears
I am using a function
Code:
Public Function Stayfor(Stay_object)
waitfor = Stay_object.exist(2)
checktime=1
While Not waitfor
wait(1)
waitfor=Stay_object.Exist(5)
checktime=checktime+1
If checktime=15 then
waitfor=True
End if
Wend
End Function

I put this function in Library file, However when I call this function it takes longer and does not recognize the VB window immediately but waits for whole 15-20 seconds before it proceeds . What is the solution in this case when I want to avoid wait statements.


RE: wait statements - surya_7mar - 07-31-2008

Code:
Public Function Stayfor(Stay_object)
      checktime=1
      While (Not Stay_object.Exist(1)) and  (checktime <=15)
            'ReTry
           checktime = checktime + 1
      Wend
End Function



RE: wait statements - sunny rao - 08-01-2008

Thanks for the reply surya . above function works!

thanks
sunny rao


RE: wait statements - RaghavendraRaichur - 08-20-2008

Hey guys,

An awesome little trick I found out a sec ago is:

Code:
SwfWindow("Core Banking Platform").SwfLabel("Post").WaitProperty "text", micRegExpMatch("\D+"), 45000

Cool thing about this is that it will wait until “text” property = regularexpression(any value or text)

I hope above one will be cool for you ...


Raghu