Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 94857

broken pipe

$
0
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:
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
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!

Viewing all articles
Browse latest Browse all 94857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>