获取窗口尺寸
返回浏览器窗口大小。
用法
browser.getWindowSize()
示例
getWindowSize.js
it('should return browser window size', async () => {
const windowSize = await browser.getWindowSize();
console.log(windowSize);
// outputs `{ width: 1280, height: 767 }`
});
返回值
- <Object>
return
: 对于W3C浏览器返回{ x, y, width, height }
,对于非W3C浏览器返回{ width, height }