1

The document inside the FlaUI Inspect pane doesn't initially appear.

When I launch the FlaUI Inspect application, the document I indicated with the arrow sign in the image, which is 'Client -- Zero Trust Fabric Agent', doesn't appear. However, after enabling the 'Hover Mode' in the FlaUI Inspect application and clicking on textbox, the document in the image appears.

Therefore, whenever I request the document in C#, I always receive a null response.

Anıl
  • 23
  • 4

1 Answers1

0

I have run into this behavior before, and it's typically because the program does not pump the WM_GETOBJECT message quickly enough or updates the elements in the GUI after having returned the automation peers.

For some background, the way UIA works is that a client (the app doing the testing) will announce itself using the WM_GETOBJECT windows message which will cause the server (the app under test) to create automation peers. However, this depends on the server processing this message after their GUI is entirely rendered and then getting to processing this message promptly. In the event, they wait too long, or they return the peers before the GUI is fully rendered you will get a list missing some or all elements. You observed that hovering over an object seems to cause the element to be there. The reason hovering over an object in the GUI with FlaUIInspect or Inspect causes ElementFromPoint to be called, raising the WM_GETOBJECT.

When I ran into this in a WPF application that I was attempting to automate the issue was the GUI elements being updated many times on loading the GUI so when the OnCreateAutomationPeer finished there were still more duplicate refreshes of the GUI which meant that the controls we made automation peers for where no longer the controls in the GUI. Hopefully, this gives you some ideas to work with.

Max Young
  • 1,522
  • 1
  • 16
  • 42