Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
wait statements
#1
Solved: 11 Years, 3 Months, 3 Weeks ago
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.
Reply
#2
Solved: 11 Years, 3 Months, 3 Weeks ago
Code:
Public Function Stayfor(Stay_object)
      checktime=1
      While (Not Stay_object.Exist(1)) and  (checktime <=15)
            'ReTry
           checktime = checktime + 1
      Wend
End Function
Reply
#3
Solved: 11 Years, 3 Months, 3 Weeks ago
Thanks for the reply surya . above function works!

thanks
sunny rao
Reply
#4
Solved: 11 Years, 3 Months, 3 Weeks ago
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to create a Reusable code for Repetitive Reporter.ReportEvent Statements notknownspammer 0 2,104 10-02-2014, 12:25 AM
Last Post: notknownspammer
  Where can I get statements for changing qtp settings. anil2u 4 6,204 05-21-2012, 12:12 AM
Last Post: ravi.gajul
  Control Statements piyush957 2 3,470 11-25-2011, 11:18 AM
Last Post: piyush957

Forum Jump:


Users browsing this thread: 1 Guest(s)