Having trouble clicking a checkbox within an ng-repeater using Protractor with the following HTML structure.
https://i.sstatic.net/FpY1x.png
The snippet of code I'm currently using is as follows:
element.all(by.repeater('user in siteUsers | filter: { SiteId: site.SiteId }'))
.then(function (ElementArray) {
ElementArray[0].all(by.tagName('input')).get(0).click();
}).catch((err) => {
console.log(err);
});
However, I keep encountering the error message below:
TypeError: Cannot read property 'all' of undefined
at C:\AGLRepository\Agl.Digital.SolarCommand.WebApi\e2eTests\src\components\settings\addRemoveUsers\addRemoveUsers.page.ts:87:32
at ManagedPromise.invokeCallback_ (C:\Users\MyDevMachine\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:1379:14)
at TaskQueue.execute_ (C:\Users\MyDevMachine\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2913:14)
at TaskQueue.executeNext_ (C:\Users\MyDevMachine\AppData\Roaming\npm\node_modules\protractor\node_modules\selenium-webdriver\lib\promise.js:2896:21)
I've also tried the solutions provided in this link, but unfortunately without success.
Thank you for your help in advance.
Click here for more details.