現在のウィンドウの左上隅の座標を取得します。

使用方法

                    .window.getPosition([callback])
                

module.exports = {
  'get current window position': function (browser) {
     browser.window.getPosition(function (result) {
       console.log('Position of current window:', result.value.x, result.value.y);
     });
  },

  'get current window position using ES6 async/await': async function (browser) {
     const {x, y} = await browser.window.getPosition();
     console.log('Position of current window:', x, y);
  }
}

パラメータ

名前 説明
callback
オプション
関数

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

戻り値

説明
*

現在のウィンドウの位置を表す座標。

参照