with version 2013.1.827 of testing framework we keep getting broken pipe errors after searching for a window:
This works fine in 2012.2.1420
it works the first time the code is called - the window is freshly created and we get a new window event, but when the window is re-used it fails. (The dock guide window has no caption - it is from the ActiPro docking framework) The window exists and is visible.
var dockGuideWindow = AtlasApp.Application.WaitForWindow(string.Empty, 10000);
var location = dockGuideWindow.Window.Location;
--->> var dockGuides = dockGuideWindow.Find.AllByType<T>(); (where T : DockGuideBase)
Exception thrown during the wait for a condition. Error: Unexpected error while waiting on condition. Error: System.IO.IOException: Pipe is broken.
at System.IO.Pipes.PipeStream.CheckWriteOperations()
at System.IO.Pipes.PipeStream.Write(Byte[] buffer, Int32 offset, Int32 count)
at ArtOfTest.WebAii.Messaging.Process.PipeCommunication.WriteCommandToPipe(PipeCommand command, PipeStream pipe, Boolean waitForDrain)
at ArtOfTest.WebAii.Messaging.Process.BrowserRemoted.ProcessBrowserRequest(BrowserCommand command, String requestId)
at ArtOfTest.WebAii.Wpf.WpfProxy.ExecuteSLCommand(SilverlightCommand cmd)
at ArtOfTest.WebAii.Wpf.WpfProxy.GetAllVisualTrees()
at ArtOfTest.WebAii.Wpf.WpfWindow.RefreshVisualTrees()
at ArtOfTest.WebAii.Silverlight.VisualFind.RefreshRoot()
at ArtOfTest.WebAii.Silverlight.VisualWait.WaitForExistsByFindInfo(VisualFindInfo findInfo)
at ArtOfTest.Common.WaitAsync._worker_DoWork[T,V](Object waitParam)
What has changed?
I have tried numerous workarounds (delays, doEvents,) to no avail
16 Answers, 1 is accepted
0
Jem
Top achievements
Rank 1
answered on 19 Sep 2013, 01:57 PM
Also once this has occurred finding other windows fails...
var window = Application.WaitForWindow("Display Properties", 1000 * retries);
Unable to find the window 'Display Properties' inside application '... Atlas.exe'
---- Current Windows: ----
Jem's Workbook - ATLAS 10
The 'current windows' shows that the caption for the dialog box is null - even though snooping shows that isn't.
var window = Application.WaitForWindow("Display Properties", 1000 * retries);
Unable to find the window 'Display Properties' inside application '... Atlas.exe'
---- Current Windows: ----
Jem's Workbook - ATLAS 10
The 'current windows' shows that the caption for the dialog box is null - even though snooping shows that isn't.
0
Hello Jem,
Boyan Boev
Telerik
The "Pipe is broken" error indicates that the application under test/recording has crashed and TS is unable to connect to it. Unfortunately this is app. specific so in order for us to investigate a possible fix we will require your WPF application and the scenario that is causing the crash.
Could you please go ahead and send us your application? If it is not possible you can create some sample one where we can reproduce the issue.
Please also upgrade the framework to our latest version which is 911.
Hope to hear from you soon.
Boyan Boev
Telerik
0
Darren
Top achievements
Rank 1
answered on 18 Nov 2013, 04:32 PM
Hi,
Further to this, I have had some time to put a demo solution together which shows some of our problem.
(We reverted to the previous version to work around it last time - Note this solution works fine with the previous version of the framework 2012.1.1420)
This fails on version 2013.1.1002.0
Please run the attached solution.
In essence it's a simple console application (VStudio 2012 .NET 4.5) which wraps the Telerik test framework. It monitors a simple WPF application which has a single main window with a single button. On pressing the button a mode-less dialog window is opened. The framework waits for this and then finds the close button which it User.Clicks(). The window should then close.
This models the way our developers have created dialog boxes in our application.
This works only on the first time that the mode-less window is open. On subsequent iterations the dialog box cannot be found and the code fails.
(please see the comments in the code)
Let me know if you receive this OK and if you have any difficulty running it
Regards
Jem Prince
Further to this, I have had some time to put a demo solution together which shows some of our problem.
(We reverted to the previous version to work around it last time - Note this solution works fine with the previous version of the framework 2012.1.1420)
This fails on version 2013.1.1002.0
Please run the attached solution.
In essence it's a simple console application (VStudio 2012 .NET 4.5) which wraps the Telerik test framework. It monitors a simple WPF application which has a single main window with a single button. On pressing the button a mode-less dialog window is opened. The framework waits for this and then finds the close button which it User.Clicks(). The window should then close.
This models the way our developers have created dialog boxes in our application.
This works only on the first time that the mode-less window is open. On subsequent iterations the dialog box cannot be found and the code fails.
(please see the comments in the code)
Let me know if you receive this OK and if you have any difficulty running it
Regards
Jem Prince
0
Daniel
Top achievements
Rank 2
answered on 18 Nov 2013, 08:37 PM
Repeatedly, it was run without issue on my machine. I changed the iterations from 50 to 10 as...well 50 is a bit much for me to sit through :) Repeated a few times, no issues. Running Windows 7 w/ .net 4.5 and VS 2012.
Code all looks good to me. I even laughed a bit at "//[Missing <summary> documentation for "P:ArtOfTest.WebAii.Core.Settings.DisableDialogMonitoring"] wtf is it?"
DisableDialogMonitoring - whether to disable dialog handling. (http://www.telerik.com/automated-testing-tools/support/documentation/user-guide/modifying-tests/test-properties.aspx - Same for VS version).
Can you post the exact error message just for reference?
Code all looks good to me. I even laughed a bit at "//[Missing <summary> documentation for "P:ArtOfTest.WebAii.Core.Settings.DisableDialogMonitoring"] wtf is it?"
DisableDialogMonitoring - whether to disable dialog handling. (http://www.telerik.com/automated-testing-tools/support/documentation/user-guide/modifying-tests/test-properties.aspx - Same for VS version).
Can you post the exact error message just for reference?
0
Darren
Top achievements
Rank 1
answered on 19 Nov 2013, 09:02 AM
Hi Daniel,
Thanks for the quick response.
We have tried it now on several machines and they always eventually get the error.
Running the compiled exe lasts for about 30 iterations on most machines (others it will do 15) , but running in the ide using the debugger only does 1. Running in the IDE without debugging usually lasts longer but eventually fails.
The exact error is:
{"Unable to find the window 'Modeless' inside application 'C:\\Users\\jem.prince\\Documents\\Visual Studio 2012\\Projects\\TestModalDialog\\WpfApplication1\\bin\\Debug\\WpfApplication1.exe'\r\n---- Current Windows: ----\r\nMainWindow\r\n--------------------------\r\n"}
Stacktrace:
at ArtOfTest.WebAii.Wpf.WpfApplication.WaitForWindow(String caption, Int32 timeout)
at TestModalDialog.MainWindow.FindModeless() in c:\Users\jem.prince\Documents\Visual Studio 2012\Projects\TestModalDialog\TestModalDialog\MainWindow.cs:line 57
Are you absolutely sure you are using the same telerik dlls' that we are?
2013.1.1002.0 - as I said we get no errors with the previous version(s).
We are running Windows 7 enterprise ServicePack 1 on a 8gb 64 bit Xeon processors with 8 cores.
You could try putting the value up to 250 ?
I have added the built exe from my machine in the zip file
Regards
Jem
PS I still don't know what 'Dialog Handling' is...
Thanks for the quick response.
We have tried it now on several machines and they always eventually get the error.
Running the compiled exe lasts for about 30 iterations on most machines (others it will do 15) , but running in the ide using the debugger only does 1. Running in the IDE without debugging usually lasts longer but eventually fails.
The exact error is:
{"Unable to find the window 'Modeless' inside application 'C:\\Users\\jem.prince\\Documents\\Visual Studio 2012\\Projects\\TestModalDialog\\WpfApplication1\\bin\\Debug\\WpfApplication1.exe'\r\n---- Current Windows: ----\r\nMainWindow\r\n--------------------------\r\n"}
Stacktrace:
at ArtOfTest.WebAii.Wpf.WpfApplication.WaitForWindow(String caption, Int32 timeout)
at TestModalDialog.MainWindow.FindModeless() in c:\Users\jem.prince\Documents\Visual Studio 2012\Projects\TestModalDialog\TestModalDialog\MainWindow.cs:line 57
Are you absolutely sure you are using the same telerik dlls' that we are?
2013.1.1002.0 - as I said we get no errors with the previous version(s).
We are running Windows 7 enterprise ServicePack 1 on a 8gb 64 bit Xeon processors with 8 cores.
You could try putting the value up to 250 ?
I have added the built exe from my machine in the zip file
Regards
Jem
PS I still don't know what 'Dialog Handling' is...
0
Hello Jem,
Unfortunately I was not able to reproduce this issue also.
Please let's try to download and install our latest internal build version of the framework and give it a try. You can download it from here.
Please give it a try and let me know the result.
You can also try to put some delay between the 2 clicks or wait for exist step for the element in the second window.
Hope to hear from you soon.
Regards,
Boyan Boev
Telerik
Unfortunately I was not able to reproduce this issue also.
Please let's try to download and install our latest internal build version of the framework and give it a try. You can download it from here.
Please give it a try and let me know the result.
You can also try to put some delay between the 2 clicks or wait for exist step for the element in the second window.
Hope to hear from you soon.
Regards,
Boyan Boev
Telerik
0
Darren
Top achievements
Rank 1
answered on 21 Nov 2013, 02:31 PM
Hi Boyan,
I have tried it with the internal build of framework
2013.1.1120.0
It still will only do 1 iteration in the VStudio IDE running debug.
Running without debug it fails after 242 iterations.
A Thread.Sleep(200) before each click makes no difference.
Regards
Jem
I have tried it with the internal build of framework
2013.1.1120.0
It still will only do 1 iteration in the VStudio IDE running debug.
Running without debug it fails after 242 iterations.
A Thread.Sleep(200) before each click makes no difference.
Regards
Jem
0
Darren
Top achievements
Rank 1
answered on 21 Nov 2013, 03:02 PM
I have also tried it on my home Windows 8 machine with the same results (ie it is not particular to the work development environment)
Have you tried running it in the Visual Studio IDE debugger?
Jem
Have you tried running it in the Visual Studio IDE debugger?
Jem
0
Hi Darren,
Allow me to step in while Boyen is out of the office. I ran it in the Visual Studio debugger and was able to reproduce the "Unable to find the window" error. After changing the wait to 5 seconds, I'm no longer seeing it. Try increasing the wait to 5 seconds. Are you still getting the error?
Regards,
Rodney
Telerik
Allow me to step in while Boyen is out of the office. I ran it in the Visual Studio debugger and was able to reproduce the "Unable to find the window" error. After changing the wait to 5 seconds, I'm no longer seeing it. Try increasing the wait to 5 seconds. Are you still getting the error?
window = AppWrap.Application.WaitForWindow("Modeless", TimePeriod.FiveSeconds * retries);
Regards,
Rodney
Telerik
0
Darren
Top achievements
Rank 1
answered on 27 Nov 2013, 08:45 AM
Hi Rodney,
I am glad you are now seeing the problem.
However increasing the timeout makes no difference on my machine - it still only manages 1 iteration.
Jem
I am glad you are now seeing the problem.
However increasing the timeout makes no difference on my machine - it still only manages 1 iteration.
Jem
0
Hi Darren,
Sorry to hear that didn't work for you. I'm seeing the behavior on one machine but not another. I'll need to look deeper into this behavior. I will update you once I've had a deeper look.
Regards,
Rodney
Telerik
Sorry to hear that didn't work for you. I'm seeing the behavior on one machine but not another. I'll need to look deeper into this behavior. I will update you once I've had a deeper look.
Regards,
Rodney
Telerik
0
Max
Top achievements
Rank 1
answered on 27 Mar 2015, 08:53 AM
Rodney
Did you find a solution to this? we are still experiencing the same problem! We have even had the application architecturally rebuilt from the ground up and we are getting it in the new version too. We are running with the latest Telerik release.
Regards
Max
Did you find a solution to this? we are still experiencing the same problem! We have even had the application architecturally rebuilt from the ground up and we are getting it in the new version too. We are running with the latest Telerik release.
Regards
Max
0
Hi Max,
No we never did get to bottom of the problem that Jem was having.
Since there have been MANY changes to Test Studio and the testing framework over the last 15 months, let's start from the beginning with your problem. First I need a repro. Are you dealing with a WPF application? If so, can you send me a sample app and sample test I can run to reproduce the problem? Once I'm able to reproduce the problem I'll be able to diagnose the root cause of the problem.
Regards,
Cody
Telerik
No we never did get to bottom of the problem that Jem was having.
Since there have been MANY changes to Test Studio and the testing framework over the last 15 months, let's start from the beginning with your problem. First I need a repro. Are you dealing with a WPF application? If so, can you send me a sample app and sample test I can run to reproduce the problem? Once I'm able to reproduce the problem I'll be able to diagnose the root cause of the problem.
Regards,
Cody
Telerik
0
Max
Top achievements
Rank 1
answered on 01 Apr 2015, 06:26 AM
Annoyingly yesterday I downloaded Jems application linked in a previous post and tried it once with the TestModalDialog console app and it failed with the problem then every subsequent attempt afterwards it did not. I then thought...ok lets create n MSTest project and do multiple iterations the way we are doing it in our actual tests and again it failed first time and then worked for every subsequent attempt.
This morning i have tried it again using the Console project and it happened after 10 loops and then second time it happened on loop 2. see attached image of the error happening and also a very slightly updated zip of the projects Jem originally posted.
This morning i have tried it again using the Console project and it happened after 10 loops and then second time it happened on loop 2. see attached image of the error happening and also a very slightly updated zip of the projects Jem originally posted.
0
Max
Top achievements
Rank 1
answered on 01 Apr 2015, 06:36 AM
Just to clarify we are using the latest version of Telerik Test framework along with VSO and TFS 2013 test agents although it is happening on our desktops too using VS 2013.
It may be a coincidence but it seems more likely to happen just after starting Visual studio and trying it for the first time and then when it starts to work correctly restarting VS2013 with the solution can then starts it occuring again
It may be a coincidence but it seems more likely to happen just after starting Visual studio and trying it for the first time and then when it starts to work correctly restarting VS2013 with the solution can then starts it occuring again
0
Hi Max,
You need to make 2 changes to your code to make it work reliably:
1) After opening any popup window you need to refresh the visual trees:
2) After clicking the button that closes the window you need to tell Test Studio that the window is closed. It is not able to automatically track this:
Regards,
Cody
Telerik
You need to make 2 changes to your code to make it work reliably:
1) After opening any popup window you need to refresh the visual trees:
public
WpfWindow FindModeless()
{
var retries = 0;
WpfWindow window =
null
;
while
(retries++ < MaxRetries)
{
Console.WriteLine(
"Attempt to FindModeless {0}"
, retries);
try
{
if
(window ==
null
)
{
AppWrap.Application.MainWindow.RefreshVisualTrees();
window = AppWrap.Application.WaitForWindow(
"Modeless"
, TimePeriod.OneSecond * retries);
// increasing wait time
if
(window ==
null
)
{
continue
;
}
}
return
window;
}
catch
(Exception ex)
{
Console.WriteLine(ex.Message);
}
}
return
null
;
}
2) After clicking the button that closes the window you need to tell Test Studio that the window is closed. It is not able to automatically track this:
public
void
HideModeless()
{
// exception here...
WpfWindow popup = FindModeless();
popup.Find.ByType<Button>().User.Click();
popup.Window.Close();
}
Regards,
Cody
Telerik