Pop-Pop handling for supply the credentials

Hi All,

I am seeing multiple folks are facing the problem on facing the pop pop to supply the credentials and I have followed the all recommendations by NewRelic but still facing the issue -
$browser.getCapabilities().then(function () {
log(1, ‘Login on’);
$browser.get(url1).then(function(){
return $browser.getAllWindowHandles();
}).then(function(handles) {
return $browser.switchTo().window(handles[1]);
$browser.sleep(5000)
$browser.findElement(By.id(“Username”)).sendKeys("");
});
$browser.findElement($driver.By.name(“Password”)).sendKeys("");
$browser.findElement($driver.By.name(“Sign in”)).click();
})
.then(function() {
return $browser.takeScreenshot();
})
Any help is much appreciable.

I have updated the code but still not working-
.then(function() {
log(1, ‘Home Page’);
return $browser.get(url1);
})
.then(function() {
return $browser.switchTo().frame(0).then(function(){
return $browser.getWindowHandle();
}).then(function(handle) {
oldWindow = handle;
console.log(‘initial window is:’ + oldWindow);
});
}).then(function() {
return $browser.getAllWindowHandles().then(function(handles) {
newWindow = handles;
//newWindow = _.difference(handles, [oldWindow])[0];
console.log(‘new window is:’ + newWindow);
});
}).then(function(){
return $browser.switchTo().window(newWindow);
})

@Ajha1 Looks like you marked this as solved. Can you confirm that is the case since your last comment mentions that the code was still not working. Thanks!

Hello Joi,

Still issue has not been resolved. I have wrongly put my comments.

Atul

@Ajha1 Thank you for confirming. I have unmarked this as “solved”. Will reach back out to our support team to get you further help on this.

@Ajha1 - Sorry to hear you are still having trouble with this. Can you let us know what error you are running into for this issue?

1 Like