WinAppDriver taking around 10 seconds to identify automationID locator
I have found an issue recently while performing a proof of concept using Appium WinAppDriver. For some reason certain buttons on a WPF application are taking 15 seconds to identify the locators. Whereas for other objects even heavily nested ones in the same application they are identified within a few seconds at most. There does appear to be a wide variety of timings however but the slow buttons are always slow for each consecutive run.
I have identified the time it takes to identify the locator by performing a time out to console before and after identification:
//order food
Console.WriteLine("Identify button start" + DateTime.Now.ToString("s"));
var button = session.FindElementByAccessibilityId("******************");
Console.WriteLine("Identify button end" + DateTime.Now.ToString("s"));
Console output:
Identify button start 2019-11-28T16:25:07 Identify button end 2019-11-28T16:25:12
WinAppDriver console output is unrevealing, running Test as debug is unrevealing. Can someone let me know how I can debug the appium driver or the findelemenybyaccessbilityID code to see what steps it goes through to identify the element in a WFP app? Or a way to debug exactly what the appium driver is doing when it goes off to find the element via the WinAppdriver.exe listener?
I am unsure what else I can provide for investigation from a c# project - if someone can let me know I will add it to this issue.
Thanks,
This really depends on how the program is setup and the # of handles that WinAppDriver has to go thru. Most of the applications I deal with WinForm / WPF are fine (1-2 seconds to find the element), yet there is another application that takes (30-45 seconds). You'll need to investigate this by comparing the performance using the UiAutomationCOM object
Thanks. Will investigate and see if we can figure out a new debugging approach.
Hi there.
I can see mention of the UIAutomation object but no specific approach I can think of to decompile it or debug the code to understand the steps it goes through. I want to understand really what it does when it goes off to get a locator, so that I can add debug into those steps, this may not be straightforward but want to give it a go, or just understand the logic so I can figure out where it is slowing down. So is there a way in which I can compare performance using the object?
I lack that knowledge sadly. If you would create a sample using WinAppDriver and the UiAutomationCOM for the WinAppDriver team they might be able to see what's up.
Thanks Clint. Sadly it feels project specific although I could try on another WPF app. Does anyone know any decent largish WPF apps I can try it on?