.window.getSize() 編集を提案
現在のウィンドウのサイズをピクセル単位で取得します。
使用法
.window.getSize([callback])
例
module.exports = {
'get current window size': function (browser) {
browser.window.getSize(function (result) {
console.log('Size of current window:', result.value.width, result.value.height);
});
},
'get current window size using ES6 async/await': async function (browser) {
const {width, height} = await browser.window.getSize();
console.log('Size of current window:', width, height);
}
}
パラメータ
名前 | タイプ | 説明 |
---|---|---|
callback オプション |
関数 | 結果の値で呼び出されるコールバック関数。 |
戻り値
タイプ | 説明 |
---|---|
* | 現在のウィンドウのサイズ。 |