Hi Admin,
I am trying to automate a application in which on switching from one page to another page execute command failed exception comes.
Switching happens when a button is clicked on home page using click() method which switches to another page of application.
Error generated is below
ExecuteCommand failed!
BrowserCommand (Type:'Information',Info:'IsReady',Action:'NotSet',Target:'null',Data:'',ClientId:'Client_8b8c8968-8891-495b-b872-90eb95904be1',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'-1',InError:'False',Response:'')
InnerException: System.IO.IOException: Pipe is broken.
at System.IO.Pipes.PipeStream.WinIOError(Int32 errorCode)
at System.IO.Pipes.PipeStream.WriteCore(Byte[] buffer, Int32 offset, Int32 count)
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.Core.Browser.ExecuteCommandInternal(BrowserCommand request)
After this exception the active browser becomes null
ActiveBrowser.IsConnected gives false and also Manager.ActiveBrowsers count is 0
Note:- When i run the test in debug mode and when i perform the click () operation the following exception is not received and ActiveBrowser.IsConnected comes true and after that test runs smoothly
Solution Tried:-
I have applied Thread.Sleep(10000) before click on the button which takes me to next page and
also after clicking the button.
8 Answers, 1 is accepted
We did more investigation on this to find the root cause.
We are modifying the database during execution and we have to refresh the page so that page is updated with latest database.
browser.refresh() is used to refresh the page.
After that, we are clicking on the button (same page) to navigate to another page which is causing the issue.
this issue is not reproducing in all machines but appearing in some machines. adding static delay is not helpful.
Can you please provide solution.
p.s. - this issue is getting solved if we modify this registry - https://feedback.telerik.com/Project/161/Feedback/Details/143944-system-io-ioexception-pipe-is-broken-when-runtohere-to-a-click-step-in-custome
but, we do not want to modify the registry at all of our test machines. Looking for fixed solution of Browser.Refresh() command.
Thank you for reaching us out and sharing details on the faced issues.
As far as I understand you both are using the Testing Framework only and there is certain scenario which is not working as expected. I would like to kindly ask for sample test which reproduces the misbehavior so that it could be investigated. It will be also helpful to know which is the version of the framework you are facing issues with.
Thanks in advance for your cooperation!
Regards,
Elena Tsvetkova
Progress Telerik
Test Studio Trainings
We are using Telerik test automation framework only with Visual Studio 2012.
1. Launch application in Internet explorer
2. Select an item in KendoGrid
3. Click a button 'remote deployment' (it will navigate to another page in same IE instance)
4. Select an item in combobox (new page, this is where exception is coming)
Same issue is coming for latest version of telerik automation framework.
Thank you for the sample. Please allow me some time to review that. In case I require any assistance on the project I will contact you. Once I managed to gather my observations will share these with you. Thanks!
Regards,
Elena Tsvetkova
Progress Telerik
Test Studio Trainings
Thanks for the sample project.
I managed to review the code and here are my comments. The click action you are using could not accept an argument whether to close the browser window or not. Once that click is modified you would need to insert new browser tracking for the new browser window to be set to active. Thus please replace the click statement which triggers the exception
_browser.Actions.Click(RemoteDeploymentButtonElement);
with the following plus the additional actions required:
RemoteDeploymentButtonElement.As<
HtmlControl
>().Click(true);
Manager.SetNewBrowserTracking(true);
System.Threading.Thread.Sleep(5000);
This should resolve the inconsistent behavior you have faced.
Thanks again for your cooperation!
Regards,
Elena Tsvetkova
Progress Telerik
Test Studio Trainings
Hi Elena,
We tried the solution given by you.
So the exception that was being raised does not occurs on using htmlcontrol click.
But the _browser.Manager.ActiveBrowser still remains null which does not solves our problem on performing the operations on the next page.
Please look into this.
Regards,
Aditya
Thank you for your cooperation!
I am sorry to hear you are still experiencing any troubles.
Please try to increase the timeout after the click. You could first start with 30 seconds and then decrease it step by step to find the optimal for performance timeout required.
If this doesn't change the behavior I would like to kindly ask you to provide a sample test against public accessible page to run on my end. This will allow me understand what might be going wrong in the execution and why the second window is not detected.
Thank you in advance for your time.
Regards,
Elena Tsvetkova
Progress Telerik
Test Studio Trainings