TestProject Forum

Getting xpath for a button in certain row of the table

Is there a way to get xpath for button in a row which has cell with a certain value


For example on the image above I would like to click on a first button in the row that contains cqyonpwbozrkcgp_order. Values are randomly generated through parameter so they wont always be in the same row.

Hi @bozic.robert1,
You can you the HTML Table Actions addon for that.
you can use the Search text action that basically search for the given text in the table and return the text’s row & column.
For example:

As you can see here it will return row = 2 and col = 0

image

Now you can check the locator of the first button in this row and use the row & col parameter to make it dynamic: