Error: Object not a collection
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Error: Object not a collection
When using the FindAll method I am getting the runtime error - Object not a collection. This only occurs on certain Windows 10 machines and only when using specific scripting languages.
Out of the four machines I've tried it on, two will get the error when using C++Script, C#Script, JScript or VBScript. If using Python or JavaScript it will work. On the other two machines FindAll works correctly for all languages.
This is done using a new project and using the FindAll example from the help file. Does anyone have an idea what could be causing this?
All PC's are running:
TestComplete 12.1
Windows 10 Pro, Version 1903, Build 18362.592
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
On the machines experiencing the problem.... are you running TestComplete as a local admin? If not.... give that a try.
Robert Martin
[Hall of Fame]
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
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Still get the issue when running it as an admin, doesn't look like there is a proper solution, only workarounds.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
/Alex [Community Champion]
____
[Community Champions] 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 Champions]
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 Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 Yatskovskaya
SmartBear Community and Education Manager
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for all the suggestions, have now contacted support and will post an update if they can find out what is causing the issue.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@TanyaYatskovska Can you mark this as unresolved? Support won't look at it as I don't have a maintenance subscription.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@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
