MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / getSize

Method getSize

javascript/selenium-webdriver/lib/webdriver.js:2404–2411  ·  view source on GitHub ↗

* Gets the width and height of the current window * @param windowHandle * @returns {Promise<{width: *, height: *}>}

(windowHandle = 'current')

Source from the content-addressed store, hash-verified

2402 * @returns {Promise<{width: *, height: *}>}
2403 */
2404 async getSize(windowHandle = 'current') {
2405 if (windowHandle !== 'current') {
2406 this.log_.warning(`Only 'current' window is supported for W3C compatible browsers.`)
2407 }
2408
2409 const rect = await this.getRect()
2410 return { height: rect.height, width: rect.width }
2411 }
2412
2413 /**
2414 * Sets the width and height of the current window. (window.resizeTo)

Callers

nothing calls this directly

Calls 2

getRectMethod · 0.95
warningMethod · 0.80

Tested by

no test coverage detected