0

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.
  • what type of application are you running it against – jasttim Oct 28 '19 at 16:00
  • The program was built in house for .NET, and I am attempting to make a DLL that I can utilize the in the 3rd party automation client. – bennickhill Oct 28 '19 at 16:07
  • 1
    I have tried a similar thing using AutoItv3 before, but my opinion would be that if the Scanner does not reveal any unique identifier then you wont be able to reliably call it from code. – jasttim Oct 28 '19 at 16:12
  • I was actually looking into that as well. I thought that maybe since I had the xpath, it might help, but I haven't been able to figure out how to use it to search for the element using UIAutomation or TestStack.White, although I did find this on TestStack.White's github page: [link](https://github.com/TestStack/White/issues/44). Would it be possible to extract the tree structure from the application and assign AutomationId's to the elements within the C# code? Essentially creating the property for where it does not exist? – bennickhill Oct 28 '19 at 16:20
  • Xpath alike is using unique identifier (like //div[@id='a']) so if there is multiple div a in your code, the framework not surely return which you need. Is all or multiple of the same identifier element enable at the same time? – Róbert Pécz Nov 04 '19 at 11:56

0 Answers0