Good day.
The problem is the following. I have a few Viewa on the page and each has an indicator.
I'm waiting for the download to finish with the following code:
var indicatorList = Page.BusyIndicatorList;
foreach (var indicator in indicatorList.Where(indicator => indicator != null && indicator.IsVisible && indicator.IsBusy))
{
indicator.Wait.Timeout = WaitBusyIndicatorTimeout;
indicator.Wait.For(_ => _.As<RadBusyIndicator>().IsBusy == false);
}
(Checked in the console:
indicatorListCount: 7
indicator: <RadBusyIndicator BaseType='ContentControl' Uid='44272189'>
indicator: <RadBusyIndicator BaseType='ContentControl' Uid='36381863'>
indicator: <RadBusyIndicator BaseType='ContentControl' Uid='24209184'>
indicator: <RadBusyIndicator BaseType='ContentControl' Uid='21613818'>
indicator: <RadBusyIndicator BaseType='ContentControl' Uid='33286939'>
indicator: <RadBusyIndicator BaseType='ContentControl' Uid='3456112'>
indicator: <RadBusyIndicator BaseType='ContentControl' Uid='43296649'>
)
On some elements on the line indicator.IsBusy throw the exception ExecuteCommandException. I intercept it, but the code does not work anymore, because this Exception detached the context from the active browser. And I can not access the browser.
StackTrace:
at ArtOfTest.WebAii.Core.Browser.ExecuteCommandInternal(BrowserCommand request)
at ArtOfTest.WebAii.Core.Browser.ExecuteCommand(BrowserCommand request, Boolean performDomRefresh, Boolean waitUntilReady)
at ArtOfTest.WebAii.Silverlight.SilverlightProxy.ExecuteSLCommand(SilverlightCommand cmd)
at ArtOfTest.WebAii.Silverlight.SilverlightProxy.GetVisibility(IAutomationPeer peer)
at ArtOfTest.WebAii.Silverlight.FrameworkElement.get_Visibility()
at ArtOfTest.WebAii.Silverlight.FrameworkElement.get_IsVisible()
at OneInc.AppOne.TestingFramework.Action.<Wait>b__0(RadBusyIndicator indicator) in ... :line 39
at System.Linq.Enumerable.WhereListIterator`1.MoveNext()
Before exception:
App.Manager.ActiveBrowser.ClientId = Client_f61cf793-5b72-48d1-b9df-239095c1cca7;
After exception:
App.Manager.ActiveBrowser.ClientId =null;