CodeceptJS
CodeceptJS copied to clipboard
How to switch to another window or tab.
I was thinking swtichTo can use to switch to windows not only on iframes.. is this possible?
Actually not, you can control only one browser instance right now.
As for tabs, I think you can do pressKey(['ctrl', 't']) to open another tab in browser and to work inside it.
In future versions we will add possibility to use several actors in tests.
If you use WebdriverIO, use something like that
changeTab(num) {
let client = this.helpers['WebDriverIO'].browser;
return client
.getTabIds(function (err, handles) {
this.switchTab(handles[num - 1]);
return;
})
}