I have been trying to switch tabs on chrome by using the following code.
driverlist = driver.window_handles
driver.switch_to_window(driverlist[1])
which works perfectly fine. But I want write a function when called switches to the next immediate tab, which is I'm trying to use send_keys functions like
from selenium.webdriver.common.keys import Keys
driver.find_element_by_tag_name('body').send_keys(Keys.CONTROL + Keys.TAB)
I'm expecting send_keys() to switch the tab focus to the next tab but when i print current_url, the focus stays on the previous tab.