Find item in custom html-component

We have a browser-based application. It has a combo-like component that contains a hierarchy like this. Menu items can be expanded and collapsed:

menuitem1
   submenuitem1
     itemA
     itemB
   submenuitem2
menuitem2
   submenuitem1
     itemA
     itemM
     itemP
 ...

Note that a few of these items appear more than once (here ItemA) so searching for ItemA in the supplied search field won’t function safely.

I work on the idea that with a given text and the knowledge on which menu item and submenu item I need to go to, I can map this to a set of keystrokes e.g. “ItemA[k(down)][k(down)][k(down)][k(enter)]” (these keystrokes won’t find ItemA here, just an example).

The tree structure has been static but may change without warning

I figure that I need a better idea. Anyone got one? Is data scraping the tree an option?

Thanks in advance.

1 Like

Yep, @HenrikCarlsen you are right.

Using keystrokes is less safer in this case.

You need frame an appropriate selector for the same.

This will help.

Thanks :slight_smile:

@HenrikCarlsen
i depends on some details but in general we can achieve a lot for such scenarios with find children Activity:

kindly note: there are different find scopes and find_descendant will help to find all items from the Root

Thank you for the reply, but I must admit I don’t understand it.

I know keystrokes are unsafe, but they would be a clumsy but sound approach.

What do you mean by “frame an appropriate selector for the same”? I have no control on how the application will change.
/hrc

1 Like

Cool @HenrikCarlsen,

  1. Keystrokes will be based on the position of the UiElement.

  2. Click the menu item using selector will be based on html tag identification (irrespective of position of element)

Both automation break on UI changes but the second is more reliant compared to the first as we are idependant of the position.

Use a click activity and indicate the sub-menu item, Optimize the selector accordingly based on your scenario.

This may help.

Thanks :slight_smile:

Thanks Peter. Don’t think that’ll work because the list is on the server side.

1 Like

can you elaborate more on it as I dont see a limitation for working with find children on it

@HenrikCarlsen, If it’s on the server side then I think selector method is the best way.

There can’t be two item A on the screen at the same time as it is server based.

Thanks :+1:

Maybe it’s me.

Have a look at my clip from the application. I can’t see how I’ll be able to go through this hierarchy with GetChildren.
Screenshot 2020-11-27 143725

Hi Nithinkrishna. Ahh, that selector! Already doing that, selecting the darn thing (with the selector), then I feed it a set of keystrokes because the search functionality is useless.

1 Like

Let me know if you want any help on that :slight_smile:

@HenrikCarlsen
have a look here:

the trees were isolated (not hierarchical) but was not manageable and retrieved. We dont know your exact structures (alsoabout the necessairy expandings). But at least it is showcasing a find children work.

The solution ended up being to replicate the tree to the form where the user made the selections. The selection generated a series of keystrokes that was saved in the parameter-file. That becomes read by UiPath and fed to the element. Not perfect but it works like a charm. Thank you for your inputs.