I want the Chrome driver to start maximized in Selenium 4 (NodeJS).
This is my Firefox/Safari solution:
this.driver = await new Builder().forBrowser("firefox").build();
await this.driver.manage().window().maximize();
But this solution does not work for Chrome. I tried this one, but it does not work, too...
let chromeoptions = new chrome.Options();
chromeoptions.addArguments("--start-maximized");
this.driver = await new Builder().forBrowser('chrome').setChromeOptions(chromeoptions).build();
Am I doing it wrong? How can I maximize the Chrome driver?
There are answers for this questions on Stackoverflow but they are out of date and/or for Python/Java and/or not working anymore in Selenium 4.