Micro Focus QTP (UFT) Forums
Error on Passing Object between functions - 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: Error on Passing Object between functions (/Thread-Error-on-Passing-Object-between-functions)



Error on Passing Object between functions - SaranKumarV - 02-15-2011

HI All,

I am trying to write a reusable action for verifying weather obect exist or not but I am getting "Object does not support this Property or Method obj.Exist" Sad

Code:
Set objxyzWin = SwfWindow("xyz")
IsMainWindowExist = WaitforObjExist(objxyzWin)
If  IsMainWindowExist = False Then
     Reporter.ReportEvent micFail,"xyz Main Window Exist","Unable to find  Main Window"
     ExitAction
End If

Reusable Action
Public Function WaitforObjExist(obj)

   temp = 1
   IsExist = False
      Do while temp < 30
        obj.Exist
        Wait(10)
   Loop
   If  temp < 30 Then
        IsExist = True
   End If
   WaitforObjExist = IsExist
End Function

Please help me on this


RE: Error on Passing Object between functions - tester_rahul - 02-15-2011

Obj.Exist will return a true or false value. I am not sure why you are using it here
Do while temp < 30
obj.Exist
Wait(10)

??????
The error is expected.


RE: Error on Passing Object between functions - SaranKumarV - 02-16-2011

Since I want to wait for about 300 sec insted of Hard coding I am using like this.
Error is only for using Infragestics controls, For the normal Web Objects or Win Objects it is woking fine