Setting an object takes too long
Hi,
i'm new to test complete. I'm trying to understand how does the Set method works. though my auto-wait timeout is set to 10 secs , i see sometimes it takes over 20 secs to set an object. Not sure what i'm doing wrong, please see my below example. My Code do identify the object , the question is why does it take long in " Set myObj = pObj.FindChild(Array("ObjectType","ObjectIdentifier"),Array(objType,objIdent),30) " ,, it doesn't take that long in all object, only some page objects. Thanks
'Calling the Function
Sub Test()
Set myPage = MyPage
If MyPage. Exists Then
Log .Message "page Found"
Set obj = FindObj(myPage ,"Textbox","ctl00_ContentPlaceHolder")
if obj.Exists Then
obj.SetText("Test")
Else
Log.Error "Object Not Found"
End If
End If
End Sbu
Function FindObj(pObj,objType,oIdent)
Set myObj = pObj.FindChild(Array("ObjectType","ObjectIdentifier"),Array(objType,objIdent),30)
if myObj .Exists Then
Set FindObj= myObj
Else
FindObj = Nothing
Set
End Function
Well, here's the thing... while the timeout setting can be adjusted, it's not something you necessarily WANT to make too short. It's a timeout, meaning that it will return earlier than the max setting once the object is found. So, you want it to be sufficiently long to be able to find the object. This is not a "problem" in the automation, it's a part of automation: detecting when objects become available.