-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
multiply tabs are not switching and closing wrong one #350
Comments
Just updated to 2.4.0 and nothing changed, switchTab is not working :( PS tab is a global var and I have 4 tabs opened in test before, latest Chrome.
I get: All tabs: CDwindow-5E7FE6C3-BC8F-4D7C-8F46-29DB9A2FCB01,CDwindow-55D008EE-A26B-494B-A923-96E39EB63472,CDwindow-3B02516B-AB48-47B8-BB7E-2780295E3EE2,CDwindow-107A2784-74E1-4950-994A-AB7C99512F1C,CDwindow-37D1E112-5717-44DB-A37C-11621030BA40 My tab: CDwindow-5E7FE6C3-BC8F-4D7C-8F46-29DB9A2FCB01 My tab: CDwindow-5E7FE6C3-BC8F-4D7C-8F46-29DB9A2FCB01 All tabs: CDwindow-5E7FE6C3-BC8F-4D7C-8F46-29DB9A2FCB01,CDwindow-55D008EE-A26B-494B-A923-96E39EB63472,CDwindow-3B02516B-AB48-47B8-BB7E-2780295E3EE2,CDwindow-107A2784-74E1-4950-994A-AB7C99512F1C,CDwindow-37D1E112-5717-44DB-A37C-11621030BA40 So it's not really related to close(), because it's behaving correctly, but to switchTab() which is not working. |
Haha. I now see the problem, make that mistake also every time. |
Oh, now I got it, it's was not so obvious and I forgetting it every time. So the goal should be in switchTab() inside the callback of getCurrentTabId or getTabIds() ? Or is there any more elegant way to do it? UPDATED client.getTabIds(function(err,response) {
var allTabs = response.slice(0);
// Assert we have {number of opened tabs} + 1 (current) tabs
assert.equal(allTabs.length, elements_cnt + 1, 'should be four new opened tabs');
//Close newly opened tabs except new one
for(var idx=1; idx<allTabs.length; idx++) {
this.switchTab(allTabs[idx]).close();
}
});
}) |
Hello!
I have a page with 4 links, which I'm opening one by one. The links are really heavy and it takes a lot of time to load them fully. After opening links I look for there ids
.getTabIds(function(err,response){ gtabIDs=response; console.log(gtabIDs);})
and try to switch to another tab
.switchTab(gtabIDs[1])
but it's impossible to switch to them, i'm always on my current tab, I checked with something like (is it dependant on a tab is loaded or not?)
.getCurrentTabId(function(err,response){console.log(response);})
The other problem is I can't close tab with .close(gtabIDs[1]) , because the only closing tab is current one
So the questions are:
PS I'm using mocha & chrome
The text was updated successfully, but these errors were encountered: