Search code examples
c#.net-framework-versionmicrosoft-ui-automation

Windows UI Automation - Not capturing all subtree elements


I m trying to capture all the sub tree elements of a particular application, in some machines I m getting all the elements, but in some machines half of the elements (i.e. Child Elements) are missing.

FindAll(TreeScope.Subtree, Condition.TrueCondition);

I have tried installing Microsoft .NET Framework 4.5 but no luck

What might be the issue? why UI Automation is behaving differently in different machines? What might be missing in client machine which is not allowing UI Automation to fetch all the child elements?

Is Microsoft .NET Framework 4.5 SDK is also required in client machine? System configuration:

Developers Machine: (Working Fine)

Operating System: Windows 7 Professional

Developing App: Visual Studio 2012 Professional

.NET Framework: 4.5.2

.NET Framework SDK: 4.5

Client Machine: (Can't able to fetch child elements)

Operating System: Windows 7 Professional

.NET Framework: 4.5

.NET Framework SDK: NA

There is no extra software installed in developer machine, Framework and Framework SDK was also installed by Visual Studio 2012 only.

Code to fetch element is straightforward, I m trying to fetch the element on mouse location:

System.Windows.Point _location = new System.Windows.Point(Cursor.Position.X,Cursor.Position.Y);

AutomationElement _ele = AutomationElement.FromPoint(_location);

Solution

  • After signing our exe we started getting all the required elements, signing exe will increase the access privileges of your application.