I\'m using the Firefox Webdriver in Python 2.7 on Windows to simulate opening (Ctrl+t) and closing (Ctrl + w) a new tab.
Just to combine the answers above for someone still curious. The below is based on Python 2.7 and a driver in Chrome.
Open new tab by: driver.execute_script("window.open("+URL+", '__blank__');")
where URL is a string such as "http://www.google.com".
Close tab by:
driver.close()
[Note, this also doubles as driver.quit()
when you only have 1 tab open].
Navigate between tabs by: driver.switch_to_window(driver.window_handles[0])
and driver.switch_to_window(driver.window_handles[1])
.