0
0
Selenium Javatesting~10 mins

Window management (maximize, size) in Selenium Java - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to maximize the browser window.

Selenium Java
driver.manage().window().[1]();
Drag options to blanks, or click blank then click option'
Aminimize
Bmaximize
Cfullscreen
DsetSize
Attempts:
3 left
💡 Hint
Common Mistakes
Using minimize() instead of maximize()
Using setSize() without parameters
2fill in blank
medium

Complete the code to get the current size of the browser window.

Selenium Java
Dimension size = driver.manage().window().[1]();
Drag options to blanks, or click blank then click option'
Amaximize
BsetSize
CgetSize
DgetPosition
Attempts:
3 left
💡 Hint
Common Mistakes
Using setSize() instead of getSize()
Using getPosition() which returns window location
3fill in blank
hard

Fix the error in setting the browser window size to 1024x768.

Selenium Java
driver.manage().window().setSize(new Dimension([1], 768));
Drag options to blanks, or click blank then click option'
A1024
B768
Cwidth
Dheight
Attempts:
3 left
💡 Hint
Common Mistakes
Using height instead of width as first parameter
Using 768 as width instead of height
4fill in blank
hard

Fill both blanks to set the browser window size to 800x600.

Selenium Java
driver.manage().window().setSize(new Dimension([1], [2]));
Drag options to blanks, or click blank then click option'
A800
B600
C1024
D768
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping width and height values
Using incorrect numbers like 1024 or 768
5fill in blank
hard

Fill all three blanks to maximize the window, get its size, and print width.

Selenium Java
driver.manage().window().[1]();
Dimension size = driver.manage().window().[2]();
System.out.println(size.[3]());
Drag options to blanks, or click blank then click option'
Amaximize
BgetSize
CgetWidth
DgetHeight
Attempts:
3 left
💡 Hint
Common Mistakes
Using getHeight instead of getWidth
Forgetting to maximize before getting size