No attributes are being recognized

Hi,

I have a test that has been running green for months on a Windows app. Now I am running the test in a new Win 11 VM and it is failing, because I’m expecting GetAttributes and Appium’s Selected() to work, and they are not.

Example
I have an element which clearly is selected (I have a menu with different tabs and this one is selected at the moment), as I can see in the Inspect tool
image

Some more properties in case it helps debuggning
image

This is my code that I run to see if the element is selected. In my old VM, it returned true or false depending on if it was selected. Now, in my new VM, it is always returning false, even though we see in the inspect tool that it should be true.
if (tabItem.Selected)
{
return;
}

The same thing happed with a checkbox I have
private bool GetToggleStateAttribute(AppiumWebElement slider)
{
return slider.GetAttribute(“Toggle.ToggleState”) == “1”;
}

I tried to debug by checking other attributes using element.GetAttribute(“Name”) for example, and they all return null in the new VM. What sometimes works however is element.Text, it returns the displayed text. For one scenario it doesn’t work though, where I have a table with maybe 10 rows, it returns Text = “Column1” instead of the text that is displayed.

What is the reason and what can I do about it?

Update: probably solved by updating the WinAppDriver version.

1 Like