Forum Discussion

SZ_1's avatar
SZ_1
Occasional Contributor
5 years ago

Error "Object doesn't support this property or method" using .Exists of returned object from Find

I have suddenly started getting the error "Object doesn't support this property or method" at the statements .Exists of returned object from Find method. This is a widespread issue to a lot of different objects. The only way I know to get the test working is to change the statement to check the returned object for not null.

1. I don’t know if checking for not null will guarantee no problem accessing the properties of the objects.

2. This means I have to go through the whole test suite to change all of such statements

 

19 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    What's changed between when it worked and when it failed?  Did you upgrade TestComplete?  

    You are correct, the Find method is supposed to return a stub object if the object is not found with "Exists" as false.  So, something changed here.  A possibility could be that ViewArea (what you're calling the Find method from) failed at some point... you may have lost that object somewhere as well which would cause a number of issues.  Double check further up the script for fail points prior to this.

  • SZ_1's avatar
    SZ_1
    Occasional Contributor

    Also the same error message was logged for all of occurrences of accessing to exception property as show below:

     

    • Wamboo's avatar
      Wamboo
      Community Hero

      Hi,

       

      What does the result of the variable "viewPort" return to you?