Relative click need solution to click element to the right of another element

@ulrich @Plankton

I need a solution to click an element to the right of another element

Seems there are hidden element in the page (hidden widget) and i can not know the exact number of the element i need to click.

I know the name of the element before I want to click in my case “Carrello” and i need to click “Aggiungi” relative to “Carrello”.

The site is widgets.php page of wordpress.

I search a xpath solution to avoid the focus problems of xclick/xtype.

xpaths anchor element
xpath=//h3[contains(.,‘Carrello’)]
xpath=//*[@id=“widget-14_woocommerce_widget_cart-i”]/div/div[2]/h3
xpath=//div[5]/div/div[2]/h3

xpaths element to click
xpath=(//span[contains(.,‘Aggiungi’)])[10]
xpath=(//span[@class=‘add’][contains(.,‘Aggiungi’)])[5]
xpath=//*[@id=“widget-14_woocommerce_widget_cart-i”]/div/div/a/span[2]
xpath=//div[5]/div/div/a/span[2]

Image
relative-click

Thanks

Hi, do you have a link to the website? I assume you already tried the Xpath contains solution?

I search a solution for relative click like imacros TAG R1 (if find first element at right of anchor) or TAG R-1 (it find first element at left of anchor).

With ui vision i do not know a similar command to detect element near another item.

This is the xpath with contains

xpath=//h3[contains(.,‘Carrello’)]

But how I can detect “Aggiungi” near at right of “Carrello” ?

“Aggiungi” showed me different [n] because in the page there are hidden element.

The secure way to detect it is

FIND “Carrello” (easy to do) (xpath=//h3[contains(.,‘Carrello’)])
After click first element near at right contains “Aggiungi”

But i can not find any solution to click a relative element because ui vision have not relative click (need image recognition green and pink box).

I search a solution similar xclickrelative but with xpath (click)

https://ui.vision/rpa/docs/xclick#relative

Imacros have this wonderful feature TAG R1 or TAG R-1 and you can detect every element near another element in ui vision is very hard to do.

Read here this wonderful feature of imacros missed on ui vision

https://wiki.imacros.net/V7_Relative_positioning

It can detect every element, need only to find an anchor the next element will be detected using a generic xpath.

For table admin provided this solution but work in tables only (better a solution like imacros tag R1 or tag R-1 that work in every site)