File tree Expand file tree Collapse file tree 1 file changed +1
-10
lines changed Expand file tree Collapse file tree 1 file changed +1
-10
lines changed Original file line number Diff line number Diff line change @@ -2667,10 +2667,7 @@ def __element_click(self, element):
2667
2667
try:
2668
2668
href = element.get_attribute("href")
2669
2669
target = element.get_attribute("target")
2670
- if len(href) > 0 and target == "_blank":
2671
- self.driver.tab_new(href)
2672
- self.switch_to_window(-1)
2673
- elif len(href) > 0:
2670
+ if len(href) > 0 and target != "_blank":
2674
2671
element.uc_click()
2675
2672
else:
2676
2673
element.click()
@@ -3407,12 +3404,6 @@ def set_content_to_parent_frame(self):
3407
3404
def open_new_window(self, switch_to=True):
3408
3405
"""Opens a new browser tab/window and switches to it by default."""
3409
3406
self.wait_for_ready_state_complete()
3410
- if hasattr(self.driver, "tab_new"):
3411
- self.driver.tab_new("about:blank")
3412
- if switch_to:
3413
- self.switch_to_window(-1)
3414
- time.sleep(0.01)
3415
- return
3416
3407
if selenium4_or_newer and switch_to:
3417
3408
self.driver.switch_to.new_window("tab")
3418
3409
else:
You can’t perform that action at this time.
0 commit comments