Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error on WPF elements
#1
Not Solved
First post, sorry it's a question. Been a long time lurker and finally needed to post my own question.

I've been having an issue with spying in on an application using WPF with UFT 11.53. The application used to work but after a recent upgrade to DevExpress 14 the application crashes when spying in on it with the following exception:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.NullReferenceException: Object reference not set to an instance of an object.
Code:
at Mercury.QTP.Avalon.Wrappers.SelectorItemObjectWrapper.CreateAutomationPeer()
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
   at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.DispatcherOperation.InvokeImpl()
   at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
   at System.Threading.ExecutionContext.runTryCode(Object userData)
   at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Windows.Threading.DispatcherOperation.Invoke()
   at System.Windows.Threading.Dispatcher.ProcessQueue()
   at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.Run(Form mainForm)
   at App1.Mdi.Program.Main()

I can still run some of the test that was written before the upgrade and it doesn't cause the application to crash, but quite a few of the elements have changed and I can't seem to object spy them any more.

Any help would be appreciated.

*Update*
I seem to have narrowed it down to the issue being with DevExpress.Xpf.WindowsUI.PageView. Anybody have any issues with this component before?
Reply
#2
Not Solved
I am also looking above issue solution. Let me know if anybody found. When i move my mouse in object i got exception error and must shut down application.
Reply
#3
Not Solved
I'm not 100% on this but starting to look like this might be related to a missing AutomationPeer class. I've found this guide on creating AutomationPeers for custom controls but haven't had a chance to chat to the devs to try it out. Here's the guide if you want to give it a try, please let me know how it goes.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Error in Code while accessing WPF object Dinesh_cts 1 3,325 11-08-2017, 11:46 PM
Last Post: lotos
  UFT not recognizing Java Objects/ Elements YogeshCallappa 0 3,338 11-08-2016, 02:44 PM
Last Post: YogeshCallappa
  Issue in WPF Automation in QTP 11 Dinesh_cts 3 8,705 09-18-2012, 12:21 AM
Last Post: rnbhushan
  QTP WPF Controls rnbhushan 0 4,727 09-18-2012, 12:05 AM
Last Post: rnbhushan
  Unable to automate WPF Context sensitive menu aditya_vardhan07 0 4,232 10-25-2011, 11:09 AM
Last Post: aditya_vardhan07

Forum Jump:


Users browsing this thread: 1 Guest(s)