anon90
anon90

Reputation: 13

Test cafe: How can i find a row based on a specific text in column and click link in a different cell within the same row

I have a table that looks something like this: Table

I am trying to click the "link" based on the text in the "name" column. e.g Look through table for the text "autotest3" and click the corresponding link in the same row

Upvotes: 1

Views: 511

Answers (1)

Dmitry Ostashev
Dmitry Ostashev

Reputation: 2348

You can specify a Selector that will find a specific table row based on the text from the "Name" column and then find a child element (table cell) from column 3. For example:

await t.click(Selector('tr').withText('Autotest2').find('td').withText('Link'));

Upvotes: 1

Related Questions