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

Method windowSize

javascript/selenium-webdriver/chromium.js:287–297  ·  view source on GitHub ↗

* Sets the initial window size. * * @param {{width: number, height: number}} size The desired window size. * @return {!Options} A self reference. * @throws {TypeError} if width or height is unspecified, not a number, or * less than or equal to 0.

({ width, height })

Source from the content-addressed store, hash-verified

285 * less than or equal to 0.
286 */
287 windowSize({ width, height }) {
288 function checkArg(arg) {
289 if (typeof arg !== 'number' || arg <= 0) {
290 throw TypeError('Arguments must be {width, height} with numbers > 0')
291 }
292 }
293
294 checkArg(width)
295 checkArg(height)
296 return this.addArguments(`window-size=${width},${height}`)
297 }
298
299 /**
300 * List of Chrome command line switches to exclude that ChromeDriver by default

Callers

nothing calls this directly

Calls 1

addArgumentsMethod · 0.95

Tested by

no test coverage detected