cancel
Showing results for 
Search instead for 
Did you mean: 

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

Occasional Contributor

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

 

error Object doesn't support this property or method.png

19 REPLIES 19
Occasional Contributor

Re: Error "Object doesn't support this property or method" using .Exists of returned objec

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

 

error Object doesn't support this property or method 2.png

Community Leader

Re: Error "Object doesn't support this property or method" using .Exists of returned objec

Hi,

 

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

Highlighted
Community Hero

Re: Error "Object doesn't support this property or method" using .Exists of returned objec

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.


Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Extensions available
Community Manager

Re: Error "Object doesn't support this property or method" using .Exists of returned objec

Hi @SZ_1,

 

We you able to find the solution?

---------
Tanya Gorbunova
SmartBear Community Manager

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓
Occasional Contributor

Re: Error "Object doesn't support this property or method" using .Exists of returned objec

Thank you all for your responses.

I will answer all of your questions here:

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

ViewPort is a WinFormsObject with properties as it should have. The image below shows some of them including the property Exists with value True:

error Object doesn't support this property or method object properties.png

 

As to response from 

As I mentioned in my post, this happened to many objects not just this one. In all cases where the error occurred, the objects were found with Exists propertt being either False or True. The only change I can think of is to have .Net framework 4.8 installed. The error started after that.

 

>>> We you able to find the solution?

No

 

 

Occasional Contributor

Re: Error "Object doesn't support this property or method" using .Exists of returned objec

Someone else posted the same problem here about 4 months ago:

https://stackoverflow.com/questions/55857445/sometimes-exists-property-is-not-supported

Occasional Contributor

Re: Error "Object doesn't support this property or method" using .Exists of returned objec

I also posted another problem which started widespread at the same time as this one. The other problem is in this thread:
Microsoft JScrip runtime error "Object not a collection"

Community Leader

Re: Error "Object doesn't support this property or method" using .Exists of returned objec

Hi,

 

I have no idea how to solve this problem.

Community Manager

Re: Error "Object doesn't support this property or method" using .Exists of returned objec

Hi @SZ_1,

 

How do you declare ViewArea?

Please post a bit more lines of your code.

---------
Tanya Gorbunova
SmartBear Community Manager

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓
New Here?
Join us and watch the welcome video:
Top Kudoed Authors