Create a navigation over a menu


I created a script to navigate over a menu in this page, based in the menu id, increment it in each iteration. Therefore, the ids aren’t sequential, so my algorithm isn’t efficient as I wanted.

I want to do a navigation the follow the order from the menu:

Central%20de%20Ajuda > Central%20de%20Ajuda(1)

How can I do this? Which commands can help?

Do you want to click on all these 8 options?

Actually, I want to click over the entire menu, dynamically, until reach the end of menu (probably using while).

While there are menu items left, click, do some stuff, and click in the next menu.

For my opinion this is an hard automation to do.

You can try to open menu using focus and tab key with xtype but it’s very hard this automation.

For my opinion this code require some days to work and it’s easy to have errors.

A more simply solution can be XClick with OCR ocr=text to click

I imagined something like find the next li witch the class bellows-menu-item:

Then look for next li bellow of this.

So to clarify: The number of menu items might change, and you want to automatically find all of them?

Not really, the number probably are the same always, but they aren’t sequential. That is the big issue with my actual algorithm, because it increment + 1 each iteration (so can take sometime to visit all the items on the menu).