Maximizing the Browser Window Using .maximizeWindow()
WebDriverIO provides a simple method to maximize the browser window called
.maximizeWindow(). This method is available to the browser object and can be called to maximize the browser window. Let's take a look at an example of how to use this method in our WebDriverIO script.
await browser.url("https://www.wikipedia.org/"); await browser.maximizeWindow(); })();
In the provided code snippet, we navigate to the Wikipedia Language Selection Page using the
.url() method. After navigating to the desired URL, we call the
.maximizeWindow() method to maximize the browser window.
Here is an example test that uses the above code snippet.