Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 97781

How to start the Chrome driver with Selenium (NodeJS) maximized?

$
0
0

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.


Viewing all articles
Browse latest Browse all 97781

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>