1

I am using this code to maximize but it is not working:

ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.addArguments("--start-maximized");
WebDriver driver = new ChromeDriver(chromeOptions);
Fijan Kaji
  • 25
  • 4

2 Answers2

3

Not to worry, try the following code

driver().manage().window().maximize();
sskini
  • 89
  • 1
  • 11
0

You can maximize it by entering the screen-size.
For example:

chromeOptions.addArguments("--window-size=1920,1080");
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
Sameer Arora
  • 4,439
  • 3
  • 10
  • 20