I have written the below code for automation using protractor.
this.promoteToOperationaltSandboxes3 = async function(){
const allMainPanel = element.all(by.className('tropos-appbox-main-panel col-md-12'));
console.log(typeof allMainPanel);
console.log('In the wait function , number of the main panels is '+allMainPanel.length);
const allLitags = await allMainPanel[0].all(by.className('dropdown-menu ng-scope')).all(by.tagName('li'));
console.log('In the wait function , number of the litags is '+allLitags.length);
}
i am calling this function in one of my spec file like this.
await appsPage.promoteToOperationaltSandboxes3();
On executing this function even the browser is not opening and giving the erorr as ;
Message: TypeError: Cannot read property 'all' of undefined Stack: TypeError: Cannot read property 'all' of undefined
Also, in the logs i can see the message as :
In the wait function , number of the main panels is undefined.
can anyone help me in resolving these issue and help me in handling the promise better.