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
  • 151,581
  • 34
  • 225
  • 281
Sameer Arora
  • 4,307
  • 2
  • 7
  • 20