In my WPF application I am using X-path, I noticed that when I am trying to locate the elements using X-path WinAppDriver taking time to locate the element and performing action, when I am using ".FindElementByAccessibilityId" for the same element it is taking less time. Any reason or am I doing wrong for locating element with X-path.
X-path: CortanaSession.FindElement(By.XPath("//ComboBox[@AutomationId='Formats']")).Click(); (Slow to locating element).
By Access Id: CortanaSession.FindElementByAccessibilityId("Formats").Click() (Fast compare to X-path).
In my WPF application I am using X-path, I noticed that when I am trying to locate the elements using X-path WinAppDriver taking time to locate the element and performing action, when I am using ".FindElementByAccessibilityId" for the same element it is taking less time. Any reason or am I doing wrong for locating element with X-path. X-path: CortanaSession.FindElement(By.XPath("//ComboBox[@AutomationId='Formats']")).Click(); (Slow to locating element). By Access Id: CortanaSession.FindElementByAccessibilityId("Formats").Click() (Fast compare to X-path).