The questions we are trying to answer here is : selenium webdriver: How to click a random value stored in grid at unknown position .
i had added a task lets say ‘Record1’ it gets stored in top of the grid with edit option and after that i had added some more tasks and all tasks have same edit option, now position of ‘Record1’ is changed to an unknown position, Now i want to create a script which always clicks on the edit button against the ‘Record1’ task.
so you can click on Edit option link by having following-sibling:: pattern in Xpath.
html/body/table/tbody/tr/td- would be xpath to hit Record1
following-sibling:: td- to hit Edit option link , depends on which td Edit link is present.
you will have to move around this xpath but i believe this approach will work.