I cannot open a new tab using Firefox WebDriver. I've found a lot of suggestions, e.g. here, here, and here, but they do not work. E.g. none of these worked:
ActionChains(driver)\
.move_to_element(driver.find_element_by_tag_name("body"))\
.key_down(Keys.CONTROL)\
.key_down("t")\
.key_up(Keys.CONTROL) \
.key_up("t") \
.perform()
or
driver.find_element_by_tag_name("body").send_keys(Keys.CONTROL + "t")
Only this works:
driver.execute_script("window.open()")
driver.switch_to.window(driver.window_handles[1])
Can anyone present a better working solution without a need to use JavaScript features?