MCPcopy Index your code
hub / github.com/SeleniumHQ/selenium / getSize

Method getSize

javascript/selenium-webdriver/lib/webdriver.js:2278–2285  ·  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

2276 * @returns {Promise<{width: *, height: *}>}
2277 */
2278 async getSize(windowHandle = 'current') {
2279 if (windowHandle !== 'current') {
2280 this.log_.warning(`Only 'current' window is supported for W3C compatible browsers.`)
2281 }
2282
2283 const rect = await this.getRect()
2284 return { height: rect.height, width: rect.width }
2285 }
2286
2287 /**
2288 * 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