TestStack / White

DEPRECATED - no longer actively maintained
Other
1.02k stars 487 forks source link

Window didn't respond, after waiting for X ms System.OutOfMemoryException thrown #642

Open Priyank06 opened 5 years ago

Priyank06 commented 5 years ago

Hi Friends,

I have implemented white test case for one of the functionality of application. Functionality which test case is executing is something like from home screen of application it will navigate to other screen after clicking button on home screen, then on landing screen it will repeatedly click on button for 50 times which is performing operation of saving data and reading data.

Requirement of the test case was to check reliability of application and in doing that test case was suppose to run for number of minutes user has enter. Code for test case was something like.

`[TestMethod] public void TestcaseName() { // Take memory snapshot Stopwatch sw = new Stopwatch(); // Stopwatch to compare time if it is equals or exceeds time enter by user. sw.Start(); bool needToRepeate = true; While(needToRepeate) { // do white framework code which will execute functionality }

if(sw.Elapsed >= time enter by user in minutes) { needToRepeate = false; // Take memory snapshot sw.stop(); } } `

Error had occurred when running test case continuously for 7 days it will be breaking at 3rd day following is logged error.

TestStack.White.UIItems.UIActionException: Window didn't respond, after waiting for 600005000 ms ---> System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown. at System.Diagnostics.NtProcessInfoHelper.GetProcessInfos(IntPtr dataPtr) at System.Diagnostics.NtProcessInfoHelper.GetProcessInfos() at System.Diagnostics.ProcessManager.GetProcessInfos(String machineName) at System.Diagnostics.Process.EnsureState(State state) at System.Diagnostics.Process.get_Threads() at MS.Internal.Automation.HwndProxyElementProvider.System.Windows.Automation.Provider.IWindowProvider.WaitForInputIdle(Int32 milliseconds) at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo) at MS.Internal.Automation.UiaCoreApi.CheckError(Int32 hr) at TestStack.White.UIItems.WindowItems.Window.WaitForWindow() in c:\TeamCity\buildAgent\work\89a20b30302799e\src\TestStack.White\UIItems\WindowItems\Window.cs:line 223 at TestStack.White.UIItems.WindowItems.Window.WaitWhileBusy() in c:\TeamCity\buildAgent\work\89a20b30302799e\src\TestStack.White\UIItems\WindowItems\Window.cs:line 184 --- End of inner exception stack trace --- at TestStack.White.UIItems.WindowItems.Window.WaitWhileBusy() in c:\TeamCity\buildAgent\work\89a20b30302799e\src\TestStack.White\UIItems\WindowItems\Window.cs:line 191 at TestStack.White.UIItems.Actions.Action.Handle(Window window) in c:\TeamCity\buildAgent\work\89a20b30302799e\src\TestStack.White\UIItems\Actions\Action.cs:line 17 at TestStack.White.UIItems.WindowItems.Window.ActionPerformed(Action action) in c:\TeamCity\buildAgent\work\89a20b30302799e\src\TestStack.White\UIItems\WindowItems\Window.cs:line 254 at TestStack.White.InputDevices.Mouse.ActionPerformed(ActionListener actionListener) in c:\TeamCity\buildAgent\work\89a20b30302799e\src\TestStack.White\InputDevices\Mouse.cs:line 190 at TestStack.White.InputDevices.Mouse.Click(Point point, ActionListener actionListener) in c:\TeamCity\buildAgent\work\89a20b30302799e\src\TestStack.White\InputDevices\Mouse.cs:line 185 at TestStack.White.UIItems.UIItem.PerformClick() in c:\TeamCity\buildAgent\work\89a20b30302799e\src\TestStack.White\UIItems\UIItem.cs:line 265 at TestStack.White.UIItems.UIItem.PerformIfValid(Action action) in c:\TeamCity\buildAgent\work\89a20b30302799e\src\TestStack.White\UIItems\UIItem.cs:line 242 at TestStack.White.UIItems.UIItem.Click() in c:\TeamCity\buildAgent\work\89a20b30302799e\src\TestStack.White\UIItems\UIItem.cs:line 231 at TestStack.White.Bricks.DelegateInvoker.VoidActionInvokerWrapper.Call(Object[] args) in c:\TeamCity\buildAgent\work\89a20b30302799e\src\TestStack.White\Bricks\DelegateInvoker.cs:line 309 at TestStack.White.Bricks.DynamicProxyInterceptors.Process(IInvocation invocation, CoreInterceptContext interceptedContext) in c:\TeamCity\buildAgent\work\89a20b30302799e\src\TestStack.White\Bricks\DynamicProxyInterceptors.cs:line 21 at TestStack.White.Interceptors.CoreInterceptor.Intercept(IInvocation invocation) in c:\TeamCity\buildAgent\work\89a20b30302799e\src\TestStack.White\Interceptors\CoreInterceptor.cs:line 31 at Castle.DynamicProxy.AbstractInvocation.Proceed() at Castle.Proxies.ButtonProxy.Click()

Value for CoreAppXmlConfiguration.Instance.BusyTimeout = execution time enter by user in minutes * 60000 + 5000;

I tried to figure out why OutofMemory exception white framework is having, but i didn't found this error in application log file where i am catching every exception.

Can anyone help me out on this please

Thanks in advance