Reputation: 13
I have implemented a white framework test case for one of the functionality of the application. Functionality which test case is executing is something like from home screen of application it will navigate to another screen after clicking the button on home screen, then on landing screen, it will repeatedly click on the button for 50 times which is performing the operation of saving data and reading data.
The requirement of the test case was to check the reliability of application and in doing that test case was suppose to run for a number of minutes the user has enter.
Value for CoreAppXmlConfiguration.Instance.BusyTimeout = execution time enter by user in minutes * 60000 + 5000;
Following is code for the test case
[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();
}
}
}
Following is full Stack trace found
TestStack.White.UIItems.UIActionException: Window didn't respond, after waiting for X 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()
Actual results: Error had occurred when running test case continuously for 7 days it will be breaking at 3rd day logged error is "Window didn't respond, after waiting for X ms".
where X is value entered by user converted to milliseconds.
Expected result: It should run test case, without any error.
I am trying to figure out why OutofMemory exception is thrown by white framework.
Can anyone help me out on this please
Thanks in advance
Upvotes: 1
Views: 338