Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

driver.manage().window().maximize(); is not working

I am using:

driver.manage().window().maximize();

to maximize the chrome screen, but it is not working and give me a message:

this statement is not getting executed. version of chrome is:Version 62.0.3202.75 (Official Build) (64-bit)

Can anybody help me to solve the issue.

like image 700
joy Avatar asked Mar 07 '23 16:03

joy


2 Answers

If you need the window to start maximised at launch, use the below code.

System.setProperty("webdriver.chrome.driver",prop.getProperty("driverpath"));
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.addArguments("--start-maximized");
WebDriver driver= new ChromeDriver(chromeOptions);
like image 57
njosep Avatar answered Mar 10 '23 11:03

njosep


it worked for me -

driver.manage().window().fullscreen();
like image 31
Punit Tiwari Avatar answered Mar 10 '23 11:03

Punit Tiwari