sdivahar
sdivahar

Reputation: 21

Windows UI Automation tools (Visual UIAVerify, Inspect.exe) recognizes the Buttons as Pane

I am using UI Automation library - TestStack.White to automate a Windows Application, where I utilize Inspect.exe to get the UI Elements from the WinForms. I have had no issues with the Inspect.exe so far except currently I am stuck with an issue in my development machine where the tool started recognizing the "Buttons" as "Pane" and the behavior is same across Visual UIA Verify, TestStack(White). Eventually all the tests are getting failed since it couldn't identify the Buttons (returns Null).

Here's what it looks like now,

[enter image description here]

Here's what it used to look and it looks in a Fresh VM,

Expected, [Ideal Behavior]

Can someone please through some light regarding this behavior or point out what would have gone wrong here ?

Thanks in Advance !

Upvotes: 2

Views: 2440

Answers (1)

Vasily Ryabov
Vasily Ryabov

Reputation: 10010

Hmm... It looks like a bug in UIAutomationCore.dll or a target application issue. I think you can't do something with that on client side. But some workarounds are possible. It's still recognized as a class name with BUTTON inside. So it's possible to do some part of your automation with a tool that can support both UI Automation (for complicated controls like WinForms list views etc) and Win32 API (like here, when it has NativeWindowHandle and adequate ClassName).

If you can consider changing the automation tool, one of the options is pywinauto. It can use Win32 API or UI Automation under the hood by your choice. The high level API is almost the same. So you can easily switch between 2 backends for different actions (having 2 different Application objects connected to one target app instance). Getting Started Guide will bring you initial guidance for the core concept.

Upvotes: 1

Related Questions