Issues automating a WPF with dynamic 'AutomationID' and no 'Name' property - C#

517 Views Asked by At

I have been working on an attempt to automate a Windows Program using C#. After using Inspect.exe from Windows Kits (SDK), it seems that many of the elements that I am trying to work with do not have a static AutomationID, an element Name, etc. The issue is that these elements may have the same properties as other elements within the same pane of the WPF, so I am trying to figure out the best way to pinpoint the element that I need.

What is the best way to overcome this issue?

Inspect.exe screenshot of one of the elements (for reference)

I have looked into the Windows UIAutomation library, as well as TestStack.White, but I am open to suggestions.

Notes:

  • The program is installed on the client machine.
  • Using Spy++, it does not find the elements within the WPF, just the parent container that the element resides in.
  • I have Windows Application Driver (and the UI Recorder) setup on my dev machine (Windows 10), BUT the programs that I am trying to automate reside on Windows 8.1, which does not seem to be supported by WAD. (Correct me if I am wrong.)
  • Using the WAD UI Recorder, I am able to get the XPATH of the element.
  • The BoundingRectangle property seems to change based on the the size of the window, which the 3rd party automation program that currently works with the program seems to intermittently display the window at different sizes.
0

There are 0 best solutions below