セッションで使用可能なすべてのウィンドウハンドルのリストを取得します。

使用方法

                    .window.getAllHandles([callback])
                

module.exports = {
 'get all window handles': function (browser) {
    browser.window.getAllHandles(function (result) {
      console.log('available window handles are:', result.value);
    });
  },

  'get all window handles with ES6 async/await': async function (browser) {
    const windowHandles = await browser.window.getAllHandles();
    console.log('available window handles are:', windowHandles);
  }
}

パラメータ

名前 説明
callback 関数

結果値と共に呼び出されるコールバック関数。

戻り値

説明
Array[string]

使用可能なすべてのウィンドウハンドルの配列。

参照

W3C WebDriver仕様