Skip to content

browser.window.handle#

Functions#

all(selenium=False) #

Get list of IDs of all open tabs or windows.

Parameters:

Name Type Description Default
selenium bool

Set to True if you want the Selenium handle IDs rather than from Browserist's internal window handle controller.

False

Returns:

Type Description
list[str]

List of IDs of all open tabs or windows.

Example
window_handles = browser.window.handle.all()

count(selenium=False) #

Count number of open tabs or windows.

Parameters:

Name Type Description Default
selenium bool

Set to True if you want the Selenium handle IDs rather than from Browserist's internal window handle controller.

False

Returns:

Type Description
int

Number of open tabs or windows.

Example
sum_of_window_handles = browser.window.handle.count()

current() #

Get the ID of the current tab or window.

Returns:

Type Description
str

ID of the current tab or window. e.g. CDwindow-69663F4BF867CC38F6AF46D55BFC1A8A.

Example
current_window_handle = browser.window.handle.current()