I am facing a challenge with a table containing 20 buttons. Half of these buttons are disabled while the other half is enabled. I am looking for a way to filter out the enabled buttons and click on each of them using a for loop. The buttons that I want to click have the class "fa fa-check". However, I am struggling with filtering out the disabled buttons.
The disabled buttons have an attribute called 'disabled' with the value 'disabled'. This is the key difference between the enabled and disabled buttons.
for (var i = 0; i < numberOfRows; ++i) { //numberOfRows
var button = element.all(by.repeater('tulemus in noue')).get(i);
button.getAttribute('disabled').then(function(status) {
if (I am unsure how to verify the correct status) {
$$('.fa-check').get(i).click();
console.log('enabled element clicked');
} else {
console.log(status);
console.log('element is disabled');
}
});
}