When using .NET 3.0 UIAutomation classes in a console application, I was surprised when a call to AutomationElement.FindFirst returned a null value. The same method when called from a .NET WinForm application returned a valid AutomationElement.
If you encounter a similar issue, please bear in mind that UI Automation APIs only work from a STA thread. So if you ever want to get UIAutomation run from the console application, remember to decorate your Main function with the STAThreadAttribute.
Ref: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1706155&SiteID=1
Subscribe to:
Post Comments (Atom)
What is success?
The journey of life takes us through varied experiences like landing an admission at a prestigious college, earning a degree, getting hired,...
-
Recently after a domain password change, I got the following error in trying to run the webrole. Can not log on locally to WebRole as us...
-
I was trying my hands at creating a .NET 2.0 component that can be consumed by a COM application. One of the errors I got in the process of...
-
After editing the post-build event of my project in VS 2005, the following error came up "'Exec' task needs a command to execut...
No comments:
Post a Comment