TargetInvocationException in Dialog Monitor

2 posts, 0 answers
  1. Jeremy
    Jeremy avatar
    1 posts
    Member since:
    Sep 2012

    Posted 21 Aug 2013 Link to this post

    Hello,

    I am seeing this exception come up randomly when logging into my company's test website. It seems to be caused/related to the Firefox Confirm Dialog although no dialog comes up on login. This started occurring after upgrading to the newest telerik framework version, 2013.1.806.0. Stopping the dialog monitor seems to fix the problem but some of our tests need this running.

    Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
    ---> System.Runtime.InteropServices.COMException: Object is not connected to server (Exception from HRESULT: 0x800401FD (CO_E_OBJNOTCONNECTED))
    10:39:52 at Accessibility.IAccessible.get_accChildCount()
    10:39:52 at MS.Internal.AutomationProxies.Accessible.GetChildCount(IAccessible acc)
    10:39:52 at MS.Internal.AutomationProxies.Accessible.GetChildren(IAccessible parent)
    10:39:52 at MS.Internal.AutomationProxies.Accessible.SetAccessibleChildrenIndexAndGetChildren(IAccessible parent)
    10:39:52 at MS.Internal.AutomationProxies.MsaaNativeProvider.System.Windows.Automation.Provider.IRawElementProviderFragment.GetRuntimeId()
    10:39:52 at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
    10:39:52 at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode)
    10:39:52 at MS.Internal.Automation.UiaCoreApi.CheckError(Int32 hr)
    10:39:52 at MS.Internal.Automation.UiaCoreApi.UiaNavigate(SafeNodeHandle hnode, NavigateDirection direction, Condition condition, UiaCacheRequest request)
    10:39:52 at System.Windows.Automation.AutomationElement.Navigate(NavigateDirection direction, Condition condition, CacheRequest request)
    10:39:52 at System.Windows.Automation.TreeWalker.GetFirstChild(AutomationElement element)
    10:39:52 at ArtOfTest.Common.Extensions.AutomationExtensions.GetControlChildrenCount(AutomationElement element)
    10:39:52 at ArtOfTest.WebAii.Win32.Dialogs.FirefoxConfirmDialogMatch..ctor(AutomationElement dialog)
    10:39:52 at ArtOfTest.WebAii.Win32.Dialogs.ConfirmDialog.MatchesUIAutomationElement(AutomationElement element)
    10:39:52 at ArtOfTest.WebAii.Win32.Dialogs.DialogMonitor.<>c__DisplayClass8.<FindUIAEDialog>b__5(IDialogUIAutomation d)
    10:39:52 at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
    10:39:52 at ArtOfTest.WebAii.Win32.Dialogs.DialogMonitor.FindUIAEDialog(AutomationElement element)
    10:39:52 at ArtOfTest.WebAii.Win32.Dialogs.DialogMonitor.HandleElement(AutomationElement element)
    10:39:52 at ArtOfTest.WebAii.Win32.Dialogs.DialogMonitor.AutomationEvent_OnStructureChanged(Object sender, StructureChangedEventArgs e)
    10:39:52 --- End of inner exception stack trace ---
    10:39:52 at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
    10:39:52 at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
    10:39:52 at System.Delegate.DynamicInvokeImpl(Object[] args)
    10:39:52 at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
    10:39:52 at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
    10:39:52 at System.Windows.Threading.DispatcherOperation.InvokeImpl()
    10:39:52 at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
    10:39:52 at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    10:39:52 at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    10:39:52 at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
    10:39:52 at System.Windows.Threading.DispatcherOperation.Invoke()
    10:39:52 at System.Windows.Threading.Dispatcher.ProcessQueue()
    10:39:52 at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
    10:39:52 at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
    10:39:52 at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
    10:39:52 at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
    10:39:52 at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
    10:39:52 at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
    10:39:52 at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
    10:39:52 at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
    10:39:52 at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
    10:39:52 at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
    10:39:52 at ArtOfTest.Common.DispatcherFactory.<>c__DisplayClass2.<CreateDispatcher>b__0()
    10:39:52 at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
    10:39:52 at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    10:39:52 at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
    10:39:52 at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
    10:39:52 at System.Threading.ThreadHelper.ThreadStart()

  2. Cody
    Admin
    Cody avatar
    3360 posts

    Posted 26 Aug 2013 Link to this post

    Hi Jeremy,

    I apologize for the delay getting back to you on this problem. I can see from the stack trace it is crashing in our code trying to setup a Confirm Dialog handler. That would explain why disabling dialog monitoring would "fix" it (until, as you state, you need dialog monitoring). I assume this is causing your test to fail.

    For us to be able to track this down and determine the root cause we're going to need to be able to reproduce it in our own source code debugging environment. Do you have a test you can send us that we can run to reproduce this problem? It will need to be against a publicly accessible URL. Our next best option is to get a Fiddler trace of your application running normally under Firefox. We can take that trace and use it to simulate your website.

    If you capture and send us a Fiddler trace, please be sure to to check "Store Binaries" and "Decrypt HTTPS traffic" before capturing the trace with Fiddler.

    Regards,
    Cody
    Telerik
    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
Back to Top