webdriverio / query-selector-shadow-dom

querySelector that can pierce Shadow DOM roots without knowing the path through nested shadow roots. Useful for automated testing of Web Components. Production use is not advised, this is for test environments/tools such as Web Driver, Playwright, Puppeteer
MIT License
242 stars 25 forks source link

Table with multiple rows wanted to find out the length(no) of rows in each page #26

Closed alpriya87 closed 4 years ago

alpriya87 commented 4 years ago

How to find out the length of rows: I have 10 rows in a page each of these have multiple column cells

  1. I wanted to find the no of rows in each page programmatically using deepquery selector
  2. I have a column that has date, how do i find if they are arranged in descending order from top to bottom using deep query selector

here is the screen for the same : Screen Shot 2020-03-17 at 4 26 12 PM

Georgegriff commented 4 years ago
  1. my guess to find the number of rows would be to use querySelectorAllDeep('mat-row') and then check the .length of the arrow returned.

  2. to check this could you do something simple like finding the first row like this https://www.w3schools.com/cssref/sel_first-of-type.asp mat-row:first-of-type <<insert-date-column-selector>> and then get last row like https://www.w3schools.com/cssref/sel_last-of-type.asp mat-row:last-of-type <<insert-date-column-selector>>

You could then compare the values i'm not sure.

Because this isn't an issue with the library and more a question on how to work with css selectors in general i'm going to close this issue.