Recall & Review
beginner
What is the purpose of controlling window size in Selenium tests?
Controlling window size helps simulate different screen sizes and resolutions, ensuring the web application works well on various devices.
Click to reveal answer
beginner
How do you set the browser window size to 1024x768 in Selenium with Python?
Use driver.set_window_size(1024, 768) to set the browser window width to 1024 pixels and height to 768 pixels.
Click to reveal answer
intermediate
What is the difference between set_window_size() and maximize_window() in Selenium?
set_window_size() sets the window to specific width and height, while maximize_window() enlarges the window to fill the screen.
Click to reveal answer
beginner
Why is it important to control window size when testing responsive web design?
Because responsive design changes layout based on screen size, controlling window size lets you test how the page adapts to different devices.
Click to reveal answer
beginner
Which Selenium method retrieves the current window size?
driver.get_window_size() returns a dictionary with 'width' and 'height' keys showing the current window size.
Click to reveal answer
Which Selenium method sets the browser window size to specific dimensions?
✗ Incorrect
set_window_size() sets the browser window to the given width and height.
What does maximize_window() do in Selenium?
✗ Incorrect
maximize_window() enlarges the browser window to fill the entire screen.
How can you get the current window size in Selenium with Python?
✗ Incorrect
driver.get_window_size() returns the current window size as a dictionary.
Why is controlling window size useful in testing web applications?
✗ Incorrect
Controlling window size helps test how the app looks on different devices and screen sizes.
Which of these is NOT a valid Selenium window control method?
✗ Incorrect
resize_window() is not a Selenium method; use set_window_size() instead.
Explain how to change the browser window size in Selenium using Python and why this is important.
Think about how websites look on phones vs desktops.
You got /3 concepts.
Describe the difference between maximize_window() and set_window_size() in Selenium.
One method is for full screen, the other for custom size.
You got /3 concepts.