I have the problem that switchTo
doesn't "focus" the tab in question. I receive the array of present tabs with getAllWindowHandles
and protractor is directing the actions to the right tab, but it never pops into foreground. Therefore elements never get visible. Am I doing something wrong here? (protractor 2.0.0, current Chrome)
var tabs;
function switchToUser1() {
return browser.switchTo().window(tabs[0]);
}
function switchToUser2() {
return browser.switchTo().window(tabs[1]);
}
beforeAll(function() {
browser.executeScript("window.open('about:blank');");
browser.getAllWindowHandles().then(function(handles) {
tabs = handles;
});
switchToUser1();
userPO.login(login1);
switchToUser2();
userPO.login(login2);
});