| || |
WPF / UIAutomation Issue
I am using QTP 11 against a .Net 4 WPF application and have been receiving error messages through the AUT during playback. One of the error messages received is:
- Recursive call to Automation Peer API is not valid.
The error message is erratic, and may appear for each test or for only one test out of five.
I have read some other forums that have indicated it may be caused by a .Net 4 UI Automation bug.
I tried to reproduce the error through a Microsoft sample application which I downloaded from the following web page:
I was able to reproduce a similar error message relating to UI Automation:
System.ArgumentException was unhandled
Message=hwnd cannot be IntPtr.Zero or null.
at System.Windows.Automation.AutomationElement.FromHa ndle(IntPtr hwnd)
at System.Threading.ThreadHelper.ThreadStart_Context( Object state)
at System.Threading.ExecutionContext.Run(ExecutionCon text executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionCon text executionContext, ContextCallback callback, Object state)
I have also noticed that if the test is running for a while the Microsoft sample application memory usage can grow from 20,000K to 1G.
Has anyone else experience a similar issue? If so, did you find a way to resolve it? For example:
Is there a .Net patch that can be installed?
Is there a configuration / code change in the AUT that can be applied?
Is there a configuration in QTP that can be set?