.window.setPosition() 編集を提案
現在のウィンドウの位置を設定します - ウィンドウを選択した位置に移動します。
使い方
.window.setPosition(x, y, [callback])
例
module.exports = {
'set current window position': function (browser) {
// Move the window to the top left of the primary monitor
browser.window.setPosition(0, 0, function (result) {
console.log('window moved successfully');
});
},
'set current window position using ES6 async/await': async function (browser) {
// Move the window to the top left of the primary monitor
await browser.window.setPosition(0, 0);
}
}
パラメータ
名前 | タイプ | 説明 |
---|---|---|
x |
数値 | ウィンドウの左上隅の新しいX座標。 |
y |
数値 | ウィンドウの左上隅の新しいY座標。 |
callback 任意 |
関数 | コマンドが完了したときに呼び出すオプションのコールバック関数。 |