MCPcopy Create free account
hub / github.com/seleniumbase/SeleniumBase / switch_to_tab

Method switch_to_tab

seleniumbase/core/sb_cdp.py:1380–1390  ·  view source on GitHub ↗
(self, tab)

Source from the content-addressed store, hash-verified

1378 self.switch_to_newest_tab()
1379
1380 def switch_to_tab(self, tab):
1381 driver = self.driver
1382 if hasattr(driver, "cdp_base"):
1383 driver = driver.cdp_base
1384 if isinstance(tab, int):
1385 self.page = driver.tabs[tab]
1386 elif isinstance(tab, cdp_util.Tab):
1387 self.page = tab
1388 else:
1389 raise Exception("`tab` must be an int or a Tab type!")
1390 self.bring_active_window_to_front()
1391
1392 def switch_to_newest_tab(self):
1393 self.switch_to_tab(-1)

Callers 6

switch_to_windowMethod · 0.95
switch_to_newest_tabMethod · 0.95
raw_cdp_tabs.pyFile · 0.45

Calls 1

Tested by

no test coverage detected