Collection was modified; enumeration operation- DEMO version

Bug reports.
fabio
Posts: 2
Joined: Tue Jul 05, 2011 2:11 pm

Collection was modified; enumeration operation- DEMO version

Post by fabio » Tue Jul 05, 2011 2:36 pm

Hi all,
I am new to the product, using demo Version 3.0.3 running on win xp Sp3 .NET runtime version 2.0.50727.3615.
I am testing on a .net based application and if I Run a simple recording (click on an interface) I get the following:

Collection was modified; enumeration operation may not execute.

Stacktrace:
at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource) at System.Collections.Generic.List`1.Enumerator.MoveNextRare() at System.Collections.Generic.List`1.Enumerator.MoveNext() at Ranorex.Core.ElementEngine.ApplyGlueRules(Element element, GlueRuleExecutionState state) at Ranorex.Core.ElementEngine.ApplyGlueRules(Element element) at Ranorex.Core.Element.GetChildren(CacheSession session) at Ranorex.Core.Element.get_Children() at Ranorex.Core.RxPath.collectAxis(LocationStep step, Axis optimizedAxis, Element self, IList`1 elements, Boolean quitOnFirstGoodNode) at Ranorex.Core.RxPath.ApplyInternal(RxPath path, Element startElement, Duration timeout, Boolean findSingle) at Ranorex.Core.Element.TryFindInternal(RxPath path, Duration timeout, Boolean findSingle, IList`1& foundElements) at Ranorex.Core.Element.TryFindSingleInternal(RxPath path, Duration timeout, Element& foundElement) at Ranorex.Core.Repository.RepoGenBaseFolder.TryGetFolderElement(Boolean& isCached, Element& folderElement) at Ranorex.Core.Repository.RepoItemInfo.Find[T](Boolean findSingle, Boolean throwException) at Ranorex.Core.Repository.RepoItemInfo.CreateAdapter[T](Boolean throwException) at Prova.ProvaRepositoryFolders.FormBlank_Page_____iET_EnterAppFolder.get_TextInserimento_Richiesta() in c:\Documents and Settings\sapform05\Documenti\Ranorex\RanorexStudio Projects\Prova\Prova\ProvaRepository.cs:line 262 at Prova.Reports.Recording1.Ranorex.Core.Testing.ITestModule.Run() in c:\Documents and Settings\sapform05\Documenti\Ranorex\RanorexStudio Projects\Prova\Prova\Reports\Recording1.cs:line 81 at Ranorex.Core.Testing.TestSuiteModule.RunInternal(DataContext parentDataContext)

I also changed application and tried to run a search in google with IE 7 and got the same error. The software seems to correctly identify the item. Please note that my application was succesfully tested on a Win Server 2003 virtual machine using ranorex 3.0.2.
Exported cs code is in attachment.

What can I do?
Thanks for any fast response you can supply!
--Fabio
You do not have the required permissions to view the files attached to this post.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Collection was modified; enumeration operation- DEMO version

Post by Support Team » Tue Jul 05, 2011 6:00 pm

Do you experience that problem only when running recordings or also when running the test suite or starting the project using the "F5" keyboard shortcut?

Please, try to run the project or test suite instead of the recording. If a similar exception occurs, please add the following line of code at the very beginning of the Main method in the Program.cs file:
[STAThread]
public static int Main(string[] args)
{
    Ranorex.Core.PluginManager.Instance.LoadDefaultPlugins();
...
It's just a shot in the dark, but maybe that's a workaround for that issue :?

Regards,
Alex
Ranorex Team

fabio
Posts: 2
Joined: Tue Jul 05, 2011 2:11 pm

Re: Collection was modified; enumeration operation- DEMO version

Post by fabio » Tue Jul 05, 2011 6:23 pm

Hi Alex,
seems your shot in the dark worked!
The Ranorex.Core.PluginManager.Instance.LoadDefaultPlugins(); did the job.
Thanks a lot and kind regards,
--Fabio

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Collection was modified; enumeration operation- DEMO version

Post by Support Team » Wed Jul 06, 2011 5:41 pm

We were able to reproduce and fix that issue with the just release Ranorex version 3.0.4. It was a race condition in loading the Ranorex plugins when the evaluation dialog comes up. Please, download the new version and report back whether it fixed your issue:
http://www.ranorex.com/download.html

Regards,
Alex
Ranorex Team