window
The command to switch the driver's context to the specified Window or Browser Tab.
Syntax
py.switch_to.window(name_or_handle: str) -> Pylenium
py.switch_to.window(index: int) -> PyleniumUsage
# Switch to a Window by handle
windows = py.window_handles
py.switch_to.window(name_or_handle=windows[1])# switch to a newly opened Browser Tab by index
py.switch_to.window(index=1)Arguments
Yields
Last updated