WinAppDriver icon indicating copy to clipboard operation
WinAppDriver copied to clipboard

Test takes too long to click on element using XPath

Open ycoliveira opened this issue 8 years ago • 3 comments

I'm doing a test where I have to click on some "Yes" buttons and I can only access those buttons using XPath but with code I'm using:

Driver.Session.FindElementByXPath("//Pane[@AutomationId='Requisitos de Pasta']").FindElementByXPath(".//Pane[@AutomationId='picBoxYes']").Click(); or Driver.Session.FindElementByXPath("//Pane[@AutomationId='Requisitos de Pasta']//Pane[@AutomationId='picBoxYes']").Click();

The test takes 14~15 sec to click on each element. Is it a normal issue?

ycoliveira avatar Feb 01 '18 13:02 ycoliveira

Hi @ycoliveira,

Element search using Xpath is known to take longer than other locator attributes. We're looking into improving Xpath performance if possible.

hassanuz avatar Feb 02 '18 22:02 hassanuz

It would be a dirty hack but xpath performance for children level elements can be improved. if the starting node of xpath indicated only child level object, this would not need the inner program (object locator of driver) to trace down all the decedents. I assume in such cases there would not be any need for WinappDriver to make an XML for all the objects and hence faster result can be acheived.

vaib-ag avatar Mar 27 '19 16:03 vaib-ag

XPath performance was improved with WinAppDriver v1.1.1.

hassanuz avatar Oct 02 '19 00:10 hassanuz