Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Passing Object to Function
#3
Solved: 5 Years, 9 Months, 1 Week ago
Just in case anyone is looking - this also works 
This is waiting for the object to appear and waits till it does, or drops out if it doesn't appear after a certain time

Function WaitForResult(theObj)
 timeSpent = 0
 waitTimeOut = 20
 Set tempObj = theObj 'example: Browser("PD").Page("SearchPage").WebTable("Results Table")
 Do While tempObj.Exist(0) = False
  If timespent = waitTimeOut Then
   Reporter.ReportEvent micFail, "Wait for Result", "Waiting for a result to occur and has not appeared in " & timeSpent & " seconds. Need to check why it has not saved. Test will stop"
         ExitTest
     Else
      Wait 1
    timeSpent = timeSpent + 1
  End If
 Loop
End Function
Reply


Messages In This Thread
Passing Object to Function - by Mozza - 07-30-2018, 05:37 AM
RE: Passing Object to Function - by Mozza - 07-31-2018, 04:50 AM
RE: Passing Object to Function - by Mozza - 08-02-2018, 03:22 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Calling a Function in Function Library when function is defined in an Action jitenderkkr 0 2,777 11-27-2014, 12:53 PM
Last Post: jitenderkkr
  Passing objects to Functions vinod.nhce 0 3,221 03-13-2014, 06:09 PM
Last Post: vinod.nhce
  How to make a function for an object that has a large number of parent objects Shroomsday 1 2,290 01-28-2014, 11:15 PM
Last Post: jacosta
  How can I fetch server time using function Now or any other function? blanchedsouza 2 4,846 11-07-2009, 08:34 PM
Last Post: Ankur
  Passing the object list as the argument arun2kindia 1 2,151 07-28-2009, 03:01 PM
Last Post: manabh

Forum Jump:


Users browsing this thread: 1 Guest(s)