Exception when method moved from .CS file to a DLL
Posted: Tue Aug 11, 2009 6:13 pm
I have moved a lot of "framework" methods (methods shared between different test scripts) to a separate DLL. However, I am getting an Exception when calling a method within the DLL from one test script but not the other.
The line of code that is throwing the exception is:
If I move this method out of the DLL and into the .CS it works fine.
Also, If I call this method from another test script it works fine.
I have just createad another test script and this is one of the very first calls. For whatever reason it is failing in the new test script but not the existing test script.
Any ideas?
Code: Select all
System.InvalidOperationException: Collection was modified; enumeration operation may not execute. 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, IDataProvider dataProvider, Duration timeout, Boolean findSingle) at Ranorex.Core.Element.FindSingle(RxPath path, Duration timeout) at Ranorex.Adapter.FindSingle(RxPath path, Duration timeout) at RanorexFramework.RFW.WaitForWindowPartialName(String WindowName, Int32 Timeout) in C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\RanorexFramework\RanorexFramework\Class1.cs:line 949 at Estimating_Regression_Test_1.Program.HardDollarEstimatingRegressionTest1() in C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\Estimating Regression Test 1\Estimating Regression Test 1\Program.cs:line 161 at Estimating_Regression_Test_1.Program.Main(String[] args) in C:\Documents and Settings\Admin\My Documents\Visual Studio 2008\Projects\Estimating Regression Test 1\Estimating Regression Test 1\Program.cs:line 106
Code: Select all
HDForm = Host.Local.FindSingle("/form[@title~'" + WindowName + ".*']", Timeout * 1000);
Also, If I call this method from another test script it works fine.
I have just createad another test script and this is one of the very first calls. For whatever reason it is failing in the new test script but not the existing test script.
Any ideas?