Find Children activity is broken when using with SAP

uiautomation
sap
activities

#1

Find Children Activity…

When using with web page or for an example Windows calculator “Find Children” activity finds all descentants just fine but when using to get all SAP gui elements (example: checkboxes) it just returns 1 element, the first one.

**Win Calculator -> OK:**
**Selector:**  <wnd app='applicationframehost.exe' appid='Microsoft.WindowsCalculator_8wekyb3d8bbwe!App' title='Calculator' />
<uia automationid='NumberPad' cls='LandmarkTarget' />
**filter:** <uia automationid='num*Button' cls='Button'/> 
-> OK 10 buttons returned

**Web -> OK:**
**Selector:** <html title='TreeScope Enum (System.Windows.Automation) | Microsoft Docs' />
<webctrl parentid='main' tag='TABLE' />
**filter:** <webctrl isleaf='1' tableRow='*' tag='TD' />
OK, 6 results

**SAP -> not ok..**
**Selector:** <wnd app='saplogon.exe' cls='SAP_FRONTEND_SESSION' title='Toimittaja riviluettelo' />
**Filter:** <sap id='usr/chk[1,*]' /> or <sap id='usr/chk*' />
Returns only first found element.

And it looks like that it is not possible to use some attributes with SAP, for example “type” (contains type like ‘GuiCheckBox’ which could be used as pretty good selector…)


#2

@JJDev

If possible, please let us know in what screen and what SAP transaction you are trying to use Find Children.


#3

We are using SAP GUI for windows 750. Screen or transaction does not matter, it fails to work all the time in every screen and transaction… even in login screen it finds just one label component even if there are lot of them visible and available under UiPath Explorer.


#4

@JJDev

Have you tried using only <sap /> as the filter?


#5

@Mateus_Cruz I did not try that earlier but tried now,… it returned a lot of elements (140 in my login test page)… so what is going on?
Why normal filter with * does not work like it works with web & other programs?
SAP version clearly works somehow as it finds one element with filter parameter… but not all that match the filter.


#6

This bug is really annoying… any tips to somehow go around it? Getting all elements with "<sap />" filter is fast about 0.2 second for getting 200 elements (at least when timing it,… not sure if that method is synchronous)

So how to do fast filtering from result? (IEnumerable<UiElements>)
Is it possible to use same kind of filter as in “Find children” activity?

Looping all and doing crude diy check “item.Get(“id”).ToString.StartsWith(“usr/txt”)” seems to be quite slow (0.1s per element!!) and not as flexible as “filter” in Find children activity…

Any tips ?