We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cf0746b commit c0f1082Copy full SHA for c0f1082
seleniumbase/fixtures/base_case.py
@@ -3103,9 +3103,14 @@ def set_content_to_parent_frame(self):
3103
def open_new_window(self, switch_to=True):
3104
"""Opens a new browser tab/window and switches to it by default."""
3105
self.wait_for_ready_state_complete()
3106
- self.driver.execute_script("window.open('');")
+ if selenium4_or_newer and switch_to:
3107
+ self.driver.switch_to.new_window("tab")
3108
+ else:
3109
+ self.driver.execute_script("window.open('');")
3110
time.sleep(0.01)
- if switch_to:
3111
+ if self.browser == "safari":
3112
+ self.wait_for_ready_state_complete()
3113
+ if switch_to and not selenium4_or_newer:
3114
self.switch_to_newest_window()
3115
3116
if self.browser == "safari":
0 commit comments