Dear all,
i have a table with products name.
Give a product i can select the next one with the instruction : driver.findElement(By.xpath("//sb-table-row[@name='"+Product+"']/following::paper-checkbox[1]")).click();
The problem is that i want the checkbox of the given product.
I've tried driver.findElement(By.xpath("//sb-table-row[@name='"+Product+"']/../following::paper-checkbox[1]")).click(); but i receive no element found error.
This is the full xpath related to the checkbox :
/html/body/sb-page-container/div/sb-product-lookup/paper-drawer-panel/iron-selector/div[1]/div[1]/sb-lookup-layout/div/div[2]/iron-list/div/sb-table-row[2]/sb-swipe-container/div/div[1]/sb-group/div/div/sb-table-cell-select/div/paper-checkbox
I do not want to use a long xpath because i have several environments and a notation like //sb-table-row[@name='"+Product+"']/following::paper-checkbox[1] is more robust.
Thanks to all for the collaboration
Fabio