0
0
Selenium Pythontesting~10 mins

Window size control in Selenium Python - Interactive Code Practice

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

Complete the code to set the browser window size to 1024x768.

Selenium Python
driver.set_window_size([1], 768)
Drag options to blanks, or click blank then click option'
A1024
B800
C1280
D640
Attempts:
3 left
💡 Hint
Common Mistakes
Using height value instead of width for the first argument.
Passing string instead of integer.
2fill in blank
medium

Complete the code to maximize the browser window.

Selenium Python
driver.[1]()
Drag options to blanks, or click blank then click option'
Amaximize_window
Bminimize_window
Cset_window_size
Dfullscreen_window
Attempts:
3 left
💡 Hint
Common Mistakes
Using fullscreen_window() which is different from maximize.
Using minimize_window() which minimizes the window.
3fill in blank
hard

Fix the error in the code to get the current window size.

Selenium Python
size = driver.[1]
Drag options to blanks, or click blank then click option'
AwindowSize
Bget_window_size()
Cwindow_size
DgetWindowSize()
Attempts:
3 left
💡 Hint
Common Mistakes
Using window_size which is not a valid property.
Using camelCase names which are not used in Python Selenium.
4fill in blank
hard

Fill both blanks to resize the window to 800 width and 600 height.

Selenium Python
driver.set_window_size([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 values like 1024 or 768.
5fill in blank
hard

Fill all three blanks to get the window size and check if width is greater than 1000.

Selenium Python
size = driver.[1]
if size['[2]'] [3] 1000:
    print('Wide window')
Drag options to blanks, or click blank then click option'
Aget_window_size()
Bwidth
C>
Dheight
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'height' instead of 'width' for comparison.
Using comparison operators like '<' or '==' instead of '>'.