简体   繁体   中英

Chrome Browser window is not maximize in Selenium-grid node

Windows are not maximize issue occurs only in grid node. we tried the different methods to get it resolved as shown below, but nothing has worked

Dimension dimension = new Dimension(1920,1080)
driver.manage().window().setSize(dimension);
driver.manage().window().maximize()
options.addArguments("--window-size=1920,1080");
options.addArguments("--start-maximized");

NOTE: No issue observed when we run the scripts locally, or if i logged into that node when the scripts is running, but when I close that node, and start the script, then window size would remain small and couldn't find some webElement

Maximize the browser with Java:

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

Another way to do with Java:

Toolkit toolkit = Toolkit.getDefaultToolkit();
Dimension screenResolution = new Dimension((int) 
                    toolkit.getScreenSize().getWidth(), (int) 
                    toolkit.getScreenSize().getHeight());

driver.manage().window().setSize(screenResolution);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM