I am trying to switch popup window of my AngularJS application. Following is my code:
browser.ignoreSynchronization = true;
browser.getAllWindowHandles().then(function (handles) {
browser.switchTo().window(handles[1]);
});
Getting following error:
Failed: null value in entry: name=null
Stack:
UnknownError: null value in entry: name=null
You might be trying to switch to a new tab before it is actually opened - wait for the window handles count to be more than a desired count with a custom Expected Condition:
In AngularJS application there is not handle for popup window ,we need to get model Id for popup and then need to identify elements on it
eg .
var alertPop = element(by.id('popId'))
expect(alertPop.isDisplayed()).toBeTruthy();
var element= alertPop.element(by.model('vm.message'));