.window.getAllHandles() 編集を提案する
セッションで使用可能なすべてのウィンドウハンドルのリストを取得します。
使用方法
.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] | 使用可能なすべてのウィンドウハンドルの配列。 |