WinAppDriver icon indicating copy to clipboard operation
WinAppDriver copied to clipboard

Issue related to number of child count

Open VijayHugar opened this issue 6 years ago • 3 comments

I am trying to get total child count under the DataPanel grid and it always returns 1 even though count is more than 1. Also note that the Datagrid children have same identification properties.

Please find the attached file for Parent child relationship.

Here is my code. .....................................................................................................................................................................

Approach1: var datagrid = session.FindElementByAccessibilityId("dataPresenter"); var rowCount = datagrid.FindElementsByXPath("/").Count;

rowCount always returns 1. I was expected 2.

Approach2: var datagrid = session.FindElementByAccessibilityId("dataPresenter"); var rowCount = datagrid.FindElementsName("ChildName").Count; Please note all children are having same identification properties. rowCount always returns 1. I was expected 2. ......................................................................................................................................................................

ParentChildRelation1

VijayHugar avatar Feb 19 '20 14:02 VijayHugar

Try using the XPath "/*". I think the astericks is XPath notation for "everything".

PandaMagnus avatar Feb 21 '20 15:02 PandaMagnus

Which version of win app driver are you using

anunay1 avatar Feb 24 '20 02:02 anunay1

@PandaMagnus Thanks for the update! I have already tried with "/*" with no luck. @anunay1 I am using latest one.

image

VijayHugar avatar Feb 24 '20 08:02 VijayHugar