Complete the code to get the current window handle.
current_handle = driver.[1]The property current_window_handle returns the handle of the current browser window.
Complete the code to get all open window handles.
all_handles = driver.[1]The property window_handles returns a list of all open window handles.
Fix the error in switching to a new window handle.
driver.[1](new_handle)The correct way to switch windows in Selenium Python is driver.switch_to.window(handle).
Fill both blanks to create a dictionary of window handles and their titles.
handles_titles = {handle: driver.switch_to.[1](handle).title for handle in driver.[2]Use driver.switch_to.window(handle) to switch to each window and driver.window_handles to get all handles.
Fill all three blanks to close all windows except the original one.
original = driver.[1] for handle in driver.[2]: if handle != original: driver.switch_to.[3](handle) driver.close()
Get the original window handle, loop through all handles, switch to each except original, then close.
