How to count the number of rows within an Angular grid in Protractor test?

719 Views Asked by At

As part of a Protractor test on my Angular app, I am trying to count the number of rows in an Angular Grid.

I am able to count the number of columns using ag-header-cell as each header / column has that CSS class:

let list = element.all(by.css('div.ag-header-cell'));
expect(list.count()).toBe(3);

But when I try to apply the same logic to the rows within the grid, 0 rows are being returned.

My code:

let list = element.all(by.css('div.ag-row'));
expect(list.count()).toBe(10);

My error message: Expected 0 to be 10.

As you can see from the below snippet, several divs have the ag-row CSS class, so I don't know why it's not picking up any:

codeSnippet

0

There are 0 best solutions below