Skip to content

Instantly share code, notes, and snippets.

@seleniumgists
Created August 9, 2018 19:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seleniumgists/d2776ac036da9db1e546767dc83394f1 to your computer and use it in GitHub Desktop.
Save seleniumgists/d2776ac036da9db1e546767dc83394f1 to your computer and use it in GitHub Desktop.
generated automatically from #selenium on seleniumhq slack
driver.wait(function() {
return driver.getAllWindowHandles().then(function(windows) {
return windows.length === 2;
});
}, 5000);
const windows = (await driver.getAllWindowHandles());
console.log(windows.length + ' windows');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment