I have a problem that switchTodoes not "focus" the tab in question. I get an array of current tabs with getAllWindowHandles, and the protractor directs the actions to the desired tab, but never appears in the foreground. Therefore, elements never become visible. Am I 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);
});
source
share