Reputation: 310
I am writing CoffeeScript tests using Webdriver.io and mocha. The code is processed using the CoffeeScript compiler.
I want to set the size of the browser window using the function
browser.setWindowSize(a, b)
If I do this in Firefox, then the size changes. However, Cromium cannot resize the browser window using this command.
I found a few more commands that should change the size of the browser window:
browser.setViewportSize({width:a, height:b})
browser.windowHandleSize(a, b)
browser.windowHandleSize({width:a, height:b})
However, the execution of these commands fails:
'browser.setViewportSize is not a function'
How can I resize the browser window in Chromium?
Upvotes: 0
Views: 1462
Reputation: 503
I don't know which version of webdriverIO you are using, but from v5, setViewportSize command does not exist anymore. Please use setWindowRect
Usage
browser.setWindowRect(x, y, width, height)
Let me know if this helps.
Upvotes: 1