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.
sb.open_new_window()
1 parent 83a51d0 commit fc3f55cCopy full SHA for fc3f55c
seleniumbase/fixtures/base_case.py
@@ -3728,7 +3728,15 @@ def open_new_window(self, switch_to=True):
3728
"""Opens a new browser tab/window and switches to it by default."""
3729
self.wait_for_ready_state_complete()
3730
if switch_to:
3731
- self.driver.switch_to.new_window("tab")
+ if self.undetectable:
3732
+ self.driver.execute_script("window.open('data:,');")
3733
+ self.switch_to_newest_window()
3734
+ else:
3735
+ try:
3736
+ self.driver.switch_to.new_window("tab")
3737
+ except Exception:
3738
+ self.driver.execute_script("window.open('');")
3739
3740
else:
3741
self.driver.execute_script("window.open('');")
3742
time.sleep(0.01)
0 commit comments