The automation task involves the use of Chrome Keyboard shortcuts like Ctrl+t, Ctrl+Tab using Selenium driver with Python.
I have used multiple methods that have been defined for using keyboard shortcuts
driver.find_element_by_tag_name('html').send_keys(Keys.CONTROL + 't')
driver.find_element_by_tag_name('body').send_keys(Keys.CONTROL + 't')
ActionChains(driver) \
.key_down(Keys.CONTROL).send_keys('t') \
.key_up(Keys.CONTROL).perform()
ActionChains(driver).key_down(Keys.CONTROL).key_down('t').key_up(Keys.CONTROL).key_up('t').perform()
But none of these seems to work. I have tried this on Chrome, Firefox and Opera. Have used Chromedriver, Geckodriver and Operadriver for the three browsers.
Has anyone been able to successfully implement shortcut keys using selenium webdriver and python?
To be more explicit, I want to cycle through the open tabs on Chrome using the "Ctrl+t" shortcut. I do not want to access tabs using the switch_to_window method