cancel
Showing results for 
Search instead for 
Did you mean: 

Error: Object not a collection

Highlighted
Contributor

Re: Error: Object not a collection

I've tried adding delays and using WaitWindow but I still get the error. I even get the error in the debugger when stepping through if I stay in the Call Stack tab, I have to actually switch to the Locals tab and view the objects in order to get by the errors.   

 

 

Community Hero

Re: Error: Object not a collection

On the machines experiencing the problem.... are you running TestComplete as a local admin?  If not.... give that a try.


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
Vegas Thrill Rider
Extensions available
Highlighted
Community Manager

Re: Error: Object not a collection

Alex, Marsha, Robert, thank you for helping!

 

Hi @StevenN , did you have any luck with running TestComplete as a local admin like tristaanogre suggests? Or, mayhaps, you found any other way to solve this? Thanks.



Sonya Mihaljova
Community and Education Specialist

 Join SmartBear Connect next April in Boston to meet with software development, API and testing experts from around the world! Get your ticket today!
Highlighted
Contributor

Re: Error: Object not a collection

Still get the issue when running it as an admin, doesn't look like there is a proper solution, only workarounds. 

Highlighted
Community Hero

Re: Error: Object not a collection

Hi,

 

Just a wild guess:

> w = p["Window"]("#32770", "Font");

The case might be related to populating dialog controls with data. It looks that when the dialog is opened, it populates itself with the list of installed fonts, their styles and pitches and renders the Font list with font samples. These actions take time and it might be that while the Font window already exists and can be referenced in code, it is still not initialized completely and thus the search for the Edit controls fails.

 

Somewhere in time, in order to resolve this and related problems, I did a loop in my test code for the required control and waited until the number of items in the list box stop to increase.

(E.g. Sys.Process("notepad").Window("#32770", "Font", 1).Window("ComboBox", "", 1).Window("ComboLBox", "", 1).wItemCount)

 

You may consider how suitable the above sounds for your case.

 

Regards,
Alex
[Community Expert Group]
____
[Community Expert Group] members 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. Postings made by [Community Expert Group] members
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.
[Community Expert Group] signature is used with permission by SmartBear Software.
http://smartbear.com/forums/f83/t86934/community-experts/
================================
Highlighted
Community Manager

Re: Error: Object not a collection

Hi @StevenN,

 

If none of the suggestions help, I recommend that you refer this question to the Support Team - they may need to investigate the issue in the test lab. You can reach out to them here:

https://support.smartbear.com/message/?prod=testcomplete

 

 

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

 Join SmartBear Connect next April in Boston to meet with software development, API and testing experts from around the world! Get your ticket today!
Highlighted
Contributor

Re: Error: Object not a collection

Thanks for all the suggestions, have now contacted support and will post an update if they can find out what is causing the issue. 

Highlighted
Contributor

Re: Error: Object not a collection

@TanyaGorbunova Can you mark this as unresolved? Support won't look at it as I don't have a maintenance subscription. 

Highlighted
Community Hero

Re: Error: Object not a collection

I agree with @tristaanogre 

 

If you can step through the code and it works, but running it causes the object to not be recognized properly, it's a timing issue.  There are several ways you can adjust the timing of the test, both within the code and in the settings, so let us know if you want help with that.

Highlighted
Community Manager

Re: Error: Object not a collection

@StevenN I've marked this unsolved. Please let the Community know if you would like the Community to help you with adjusting timing.



Sonya Mihaljova
Community and Education Specialist

 Join SmartBear Connect next April in Boston to meet with software development, API and testing experts from around the world! Get your ticket today!