Highlighted
Absent Member.. jomarnavarro Absent Member..
Absent Member..
2405 views

Issues working with .NET app

Hi all,

 

     I'm working with QTP 11.0 to automate a .NET application, but the .NET add-in is having trouble recognizing some objects.   I hear from a blog that I might be missing patch QTP_00709 (http://www.joecolantonio.com/2011/02/03/qtp-11-patch-fixes-net-bpt-service-test-and-other-issue/).  Specially in the part where some objects are seen as SwfObjects.

 

     Also, when performing some actions such as highlighting objects or spying upon them, I get the following exception and the application closes:

 

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: hwnd must not be IntPtr.Zero (0) or null.
at System.Windows.Automation.Provider.AutomationInteropProvider.HostProviderFromHandle(IntPtr hwnd)
at MS.Internal.Automation.ElementProxy.get_HostRawElementProvider()
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at MS.Internal.Automation.UiaCoreApi.CheckError(Int32 hr)
at MS.Internal.Automation.UiaCoreApi.UiaFind(SafeNodeHandle hnode, UiaFindParams findParams, Condition findCondition, UiaCacheRequest request)
at System.Windows.Automation.AutomationElement.Find(TreeScope scope, Condition condition, UiaCacheRequest request, Boolean findFirst, BackgroundWorker worker)
at System.Windows.Automation.AutomationElement.FindAll(TreeScope scope, Condition condition)
at Mercury.QTP.Avalon.SelectionProcessor.GetContent()
--- 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)

 

I hear that patch QTPNET_00062 fixes related issues:

1. QuickTest Professional sometimes caused .Net 4 WPF applications with multiple AppDomains to crash.

2. QuickTest Professional sometimes caused an error message to be displayed by the application when

spying on a specific WPF combo box.

 

Finally, A hot Fix was created to fix a related issue, that occurred when running a step using the Select
method on WpfList, WpfComboBox, and WpfTabStrip test objects. Sometimes the
Select method failed to select the specified item, and sometimes it caused
the application to display an error message: QTPNET_00056

Could you indicate locations to these three patches/hot fixes, and any dependencies between them:

QTP_00709

QTPNET_00062

QTPNET_00056

 

Tags (2)
0 Likes
6 Replies
Absent Member.. jomarnavarro Absent Member..
Absent Member..

Re: Issues working with .NET app

HI all,

 

 

Additionally, Support site suggests the following ones in Knowledge Management Document ID KM1226894:


QTPNET_00092 - Fix _Object_ reference lost after replaying some methods on WPF controls created thro...,
QTPNET_00096 - Fix Several WPF Add-in Issues,
QTPNET_00103 - Several Improvements for the Windows Presentation Foundation (WPF) Add-in

 

 

Please provide access to the hot fixes above, or patches which may contain them. 

 

 

 

 

0 Likes
Absent Member.. RoniRobinson Absent Member..
Absent Member..

Re: Issues working with .NET app

If you have a current support contract, you should be able to download these patches from the Downloads page. If you were viewing the KM document, there were probably links to the patches at the bottom.
0 Likes
Absent Member.. Manoj_Ahire Absent Member..
Absent Member..

Re: Issues working with .NET app- System.Reflection.TargetInvocationException: Exception

Hi All,

 

I am facing the similar problem in my application. I have tried with the installation of mentioned patches on below url but no use.

Addins: QTPNET_00062 , QTPNET_00092, QTPNET_00096, QTPNET_00103

 

http://h30499.www3.hp.com/t5/Unified-Functional-Testing/Issues-working-with-NET-app/td-p/5680865

 

Issue Desc:  Application having WPF Object’s which is identified by QTP but it is not able to work on WpfEdit object ( text box).

Whenever we tried to work on WpfEdit object we are getting unhandled error as mentioned in Service Request # 4648305037

Getting 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.

 

 Error snap is attached

 

Kindly let me know any resolution as we stuck in automation work.

0 Likes
Ana_Noncheva Absent Member.
Absent Member.

Re: Issues working with .NET app

Hello,

 

Patches QTPNET_00062 & QTPNET_00056 are internal, but sre superseded by the publically available QTPNET_00120.

Please find the critical publically available patches for QTP 11 here: http://support.openview.hp.com/selfsolve/document/KM934172

 

Regards,

Ana

“HP Support
If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution.”
0 Likes
Absent Member.. Manoj_Ahire Absent Member..
Absent Member..

Re: Issues working with .NET app

Hi Ana,

 

Thanks for the response. I have checked by installing the QTPNET_00120 patch but still getting the same exception message.

 

Regards,

Manoj

0 Likes
Ana_Noncheva Absent Member.
Absent Member.

Re: Issues working with .NET app

Hello,

 

Did you also install the QTP_00709 critical patch?

Do you observe the problem for specific objects only? Is it always reproducible against them or rather randomly?

Is the problem observed during recording, replaying or spying against those objects?

Do you observe the problem for specific .NET app only and not for another?

Do you observe the problem on specific QTP machine only and not on another?

 

You may also try to reregister the .NET dlls as suggested here: http://support.openview.hp.com/selfsolve/document/KM1280387

 

Regards,

Ana

“HP Support
If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution.”
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.