1
Vote

Problem closing multiple automated applications

description

I'd like to be able to have more than one automated application running at a time. I'm able to open them and automate them, but there seems to be some sort of problem when I close them. It seems that when I close one, one or more of the remaining ones will also close. However, their associated objects appear to be intact. I get the following exception when I try to close the second application:

System.InvalidOperationException was unhandled
Message=Unsupported Pattern.
Source=UIAutomationClient
StackTrace:
   at System.Windows.Automation.AutomationElement.GetCurrentPattern(AutomationPattern pattern)
   at Microsoft.Test.ApplicationControl.UIAutomationApplicationImpl.CloseProcessWorker()
   at System.Threading.ThreadHelper.ThreadStart_Context(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.Threading.ThreadHelper.ThreadStart()
InnerException:

file attachments

comments

PaulEbert wrote Feb 22, 2013 at 7:33 PM

Attached is some code that exhibits the problem.