Switches control of the browser to the specified window. The window can be an integer: 0 -> 1st tab, 1 -> 2nd tab, etc... Or it can be a list item from self.driver.window_handles
(self, window, timeout=None)
| 4047 | self.wait_for_ready_state_complete() |
| 4048 | |
| 4049 | def switch_to_window(self, window, timeout=None): |
| 4050 | """Switches control of the browser to the specified window. |
| 4051 | The window can be an integer: 0 -> 1st tab, 1 -> 2nd tab, etc... |
| 4052 | Or it can be a list item from self.driver.window_handles""" |
| 4053 | self.__check_scope() |
| 4054 | if not timeout: |
| 4055 | timeout = settings.SMALL_TIMEOUT |
| 4056 | if self.timeout_multiplier and timeout == settings.SMALL_TIMEOUT: |
| 4057 | timeout = self.__get_new_timeout(timeout) |
| 4058 | if self.__is_cdp_swap_needed() and not isinstance(window, str): |
| 4059 | self.cdp.switch_to_tab(window) |
| 4060 | return |
| 4061 | page_actions.switch_to_window(self.driver, window, timeout) |
| 4062 | |
| 4063 | def switch_to_default_window(self): |
| 4064 | self.switch_to_window(0) |
no test coverage detected