Since there is new data loaded into the grid, we can find the existing row in the grid, check the box and make sure that the previously located row is now "out of date":
var EC = protractor.ExpectedConditions;
var existingRow = element(by.css("#mygrid tr"));
checkbox.click();
browser.wait(EC.stalenessOf(existingRow), 5000);
Another approach might be to wait for the number of rows in the grid to change:
element.all(by.css("#mygrid tr")).count().then(function (countBefore) {
checkbox.click();
browser.wait(function () {
return element.all(by.css("#mygrid tr")).count().then(function (countAfter) {
return countBefore !== countAfter;
});
}, 5000);
});
source
share