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]
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)