Skip to content

← All questions

How do you assert on a row in a table without writing a CSS chain?

Asked 8,120 views2 answers

Orders table, and the scenario I want reads:

gherkin
Then order "1042" should show status "Shipped"

What I have in the page object is this, which works until someone sorts the table or the row moves to page two:

ts
this.page.locator('tbody tr:nth-child(3) td:nth-child(4)');

Is there a table-aware step I have missed, or is this a page-object job?

asked by Sunita Kale982 ·

2 answers

Know the answer?

Reviewed before it appears. Wrap commands and output in triple backticks and they will render as a code block.

Have a different question? Ask it.

Related