6. Window and Screen Management

Estimated reading: 1 minute 24 views

Below are some common methods that can be used with manage().window() to manipulate the window:

Method NameDescriptionExample Syntax
maximize()Maximizes the browser window to fill the entire screen.driver.manage().window().maximize();
minimize()Minimizes the browser window.driver.manage().window().minimize();
fullscreen()Switches the browser window to fullscreen mode.driver.manage().window().fullscreen();
setSize(Dimension)Sets the size of the browser window by specifying the width and height in pixels.driver.manage().window().setSize(new Dimension(1024, 768));
setPosition(Point)Sets the position of the browser window on the screen, specified by x and y coordinates.driver.manage().window().setPosition(new Point(50, 50));

Leave a Comment

Share this Doc

6. Window and Screen Management

Or copy link

CONTENTS