Solved
Forum Discussion
AlexKaras
Champion Level 1
8 years agoHi,
Observed behavior is correct and expected one.
When object is not found, the value returned by MyObj() is not an object. Thus it obviously does not contain the .SetText() method.
Suggested code modification:
Function PoScreen Set sPage=Aliases.browser.MainPage 'Selects Company strEffDteProp=Array("ObjectIdentifier","ObjectType") strEffDtePropVal=Array("DisplayEffectiveDate","Textbox") Set objEffDte=MyObj (sPage,strEffDteProp,strEffDtePropVal) If (objEffDte.Exists) Then objEffDte.SetText"11/01/2017" Else ... ' process appropriately End If End Function '@@@@@@@@@@@@@@ Function MyObj(sPage,arrProp,arrVal) ' Set obj=sPage.FindChild(arrProp,arrVal,50) ' If (obj.Exists) Then ' Set MyObj=obj ' Else ' Log.Message"Obj Not Found" ' End If Set MyObj=sPage.FindChild(arrProp,arrVal,50) If (Not MyObj.Exists) Then Log.Message"Obj Not Found" End If End Function
- salley8 years agoFrequent Contributor
Thank you so much,,,,,,,,,,,,,,,, got it,