WinAppDriver
WinAppDriver copied to clipboard
Enable always returns true
So I have a conditional if in my code that looks to a button.enable value, if true, click on it, if false, skip. But the .enable is returning True even when the button isn't enabled. Is that a common issue and is there any turning around for it? (I've looked in the pageSource and enable is true there either)

here's my code
public void DadoQueEuPreenchaOAtendimentoDeCadaItemDaSM()
{
var pumaItemsEmbarqueTransbordo = App.Session.FindElementsByAccessibilityId("PUMAItemEmbarqueTransbordo");
foreach (var item in pumaItemsEmbarqueTransbordo)
{
item.FindElementByAccessibilityId("picCollapse").Click();
var editar = item.FindElementByAccessibilityId("btnEditAtendimento");
if (editar.Enabled)
{
editar.Click();
App.Session.FindElementByName(EditarSM.SelecionarAtendimento).Click();
item.FindElementByAccessibilityId("picCollapse").Click();
}
}
}
What's your app type, Universal Windows Platform (UWP), Windows Forms (WinForms), Windows Presentation Foundation (WPF), and Classic Windows (Win32)?
If you hit this randomly, it's possible a timing issue. Maybe you are checking Enabled before click(picCollapse) is completed. So you can sleep seconds before if (editar.Enabled)