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

Highlighted
Occasional Contributor

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

To 

Wherever GetViewPort(viewArea) is called with viewArea passing in, the viewArea is returned from Find method. 

e.g.

viiewArea.png

 

Highlighted
Community Manager

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

Thanks. Will it help if you set some delay among your operations:

Delay(500);
---------
Tanya Gorbunova
SmartBear Community Manager

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today
Highlighted
Occasional Contributor

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

Delay did not work. I already tried different times of delay even as long as 1000, 2000.

 

I have found a workaround:

If I access a different property e.g. Name before access Exists, there is no error at .Exists:

Added viiewPort.Name.png

 

The problem is that I need to add this .Name line everywhere before .Exists statements for all of the objects.

Hope this helps you to find some clues what might be the cause.

Highlighted
Community Manager

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

Hmmm. This sounds strange.

Are you using TestComplete 14.20? This is the latest product version. I think it's worth checking it.

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

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today
Highlighted
Occasional Contributor

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

TestComplete 11.31. I could upgrade it to 12.XX but decided to stay with 11.31 as in the past when I upgraded the main version of TestComplete, some of the test scripts would stop working and needed to update.

Highlighted
Occasional Contributor

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

@TanyaGorbunova 

Also as I mentioned in my original post, checking for not null or null does not throw any error but I need to know if checking for not null will guarantee no problem accessing the properties of the objects.

I tried this on the niewPort and it worked so far as viewPort has been alwasy found.

Check viiewPort for not null.png

Highlighted
Community Manager

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

Hi @SZ_1,

 

One more thing to check - make sure that the Auto-wait timeout option is set to more than 10000 in your project.  You can find the details here: https://support.smartbear.com/testcomplete/docs/working-with/managing-projects/properties/playback.h...

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

Learn SmartBear products in a fun and easy way and prove your knowledge!
>>Participate in the TechCorner Challenge today
Highlighted
Occasional Contributor

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

Thanks TanyaGormunova! I have already had the Auto-wait timeout set to 10000 ms. Also I don't stop test run on error. However, the test will stop if a runtime error occurs like this one.

Highlighted
Community Hero

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

Hi,

 

I need to know if checking for not null will guarantee no problem accessing the properties of the objects.

No. As it is documented, .FindXXX() method always returns found object or object stub if the search finds nothing.

Thus check for not null will always succeed.

Correct way is to check for object.Exists and use aqObject.IsSupported(...) when needed.

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
Highlighted
Occasional Contributor

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

At AlexKaras

Thanks for your reply. I had realised that after I posted the messages and I already pointed this out on this thread on stackoverflow:

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

New Here?
Join us and watch the welcome video:
Announcements
Join TechCorner Challenge!
Want a fun and easy way to learn TestComplete? Try solving weekly TechCorner challenges and get into the Leaderboard!

Challenge Status

How to execute remote test and obtain results via Test Runner REST API

Participate!

Comparing content of HTML table with Excel file data

Participate!

Compare HTML table with Excel file and correct data in the file

Participate!

Retrieve Data from a Web Page

Participate!
Top Kudoed Authors