Forum Discussion

kaiiii's avatar
kaiiii
Regular Contributor
5 years ago
Solved

Need to handle an object when don't exist, so it will not post error in log.

I am trying to handle a object that mostly time doesn't exist in application, it giving me error in test log but my execution is continue.   "Unable to find the object TextNode(0). See Details fo...
  • tristaanogre's avatar
    5 years ago

    "Exists" is a property of the object.  So, you can't check a property of an object if the object itself does not exist. So, you need to use a slightly different method.  Try this

     

    Set Sold = page.Section(2).Panel(0).Panel(1).Panel("shopLastItem").Panel(0).Section(0).Panel(1).Panel(0).Panel(0).FindChild('ObjectType','TextNode')
    
    If (Sold.Exists = True) Then
    
       'Some kind of logic here
    
    End IF