Skip to content

← All questions

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

Example threads. These questions and answers were written by the SDODS team to document real problems and how to fix them. The people named are illustrative, not real users. Questions asked on this site are marked new.

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?

2 answers

Know the answer?

Wrap commands and output in triple backticks and they will render as a code block.

Checking whether you’re signed in…

Have a different question? Ask it.

Related