WinAppDriver icon indicating copy to clipboard operation
WinAppDriver copied to clipboard

findelement by Xpath is way too slower than findElementByName

Open vaib-ag opened this issue 7 years ago • 4 comments

HI, I am trying to find and attach to a window from desktop session. When i use findElementByName the window is found within 1 second. desktopSession.findElementByName("InfoSphere DataStage Designer - DELVM07S08\dstage1 - [Parallel - dummy1]"); 2019-03-27 12:38:29.801 2019-03-27 12:38:30.110

However while using xPath it takes approx 19 seconds. (After updating to v1.1.1 it takes approx 14-15 seconds. desktopSession.findElementByXPath("//Window[contains(@Name, 'InfoSphere DataStage Designer')]"); 2019-03-27 12:54:28.829 2019-03-27 12:54:41.642

Reason for using xPath is that name is not constant and hence using contains() of xpath. NOTE: using exact name in xpath is also slow and takes approximately same time as contains().

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

Yes, I have same issue. As in my testing application, there is not unique attribute to identify the element, so I have to use xpath. However it takes about 10+ seconds to find the element.

samchen63 avatar May 14 '19 23:05 samchen63

Using absolute xpath generated by UIRecorder should be much faster.

JunlinZhu avatar May 15 '19 23:05 JunlinZhu

Using absolute xpath generated by UIRecorder should be much faster.

Thanks. Comparing with ID, using absolute xpath is still slow, but it is much faster than relative xpath.

samchen63 avatar May 16 '19 00:05 samchen63

is there any update on this issue ? coz the problem still exists i.e findelementByXpath works very slow comparing others

ankurgup510 avatar Aug 27 '24 04:08 ankurgup510