WinAppDriver icon indicating copy to clipboard operation
WinAppDriver copied to clipboard

WinAppDriver 1.0 How to get BackgroundColor/ForegroundColor of element in Native Wins App

Open hainguyenh opened this issue 9 years ago • 3 comments

I tried to use GetAttribute of element to get text patterns like background color, foreground color... but unlucky. Please can help!

hainguyenh avatar Aug 24 '17 05:08 hainguyenh

Hi @hainguyenh,

You can use GetAttribute to get all element attributes shown on inspect.exe such as Name, ControlType, IsEnabled, etc. Some examples can be found on our sample test below: https://github.com/Microsoft/WinAppDriver/blob/v1.0-RC/Tests/WebDriverAPI/ElementAttribute.cs#L38

Unfortunately, other attributes like background color and foreground color are not exposed through the accessibility layer which made it not accessible in Windows Application Driver.

timotiusmargo avatar Aug 25 '17 02:08 timotiusmargo

Hi @timotiusmargo,

Thanks a lot for your confirmation.

hainguyenh avatar Aug 25 '17 06:08 hainguyenh

What accessibility layer are you referring to? Is this in Appium or the Windows control?

cgetty12 avatar Jun 12 '20 14:06 cgetty12