0

python code:--

import selenium.webdriver.support.ui as ui
from selenium.webdriver.common.keys import Keys
from time import sleep
from selenium import webdriver

browser = webdriver.Chrome('driver/chromedriver.exe')
browser.get('https://www.google.com')
main_window = browser.current_window_handle

a = browser.find_element_by_xpath("//input[@name='q']")
a.send_keys(Keys.CONTROL + 't')

it not showing any error and not opening any Tab.

the code "a.send_keys(Keys.CONTROL + 't')" might not working (fix it or any alternative sol.)

  • Try with this element `a = browser.find_element_by_xpath("/html/body")` – KunLun Sep 01 '20 at 09:17
  • 1
    Does this answer your question? [Open web in new tab Selenium + Python](https://stackoverflow.com/questions/28431765/open-web-in-new-tab-selenium-python) – Dev Sep 01 '20 at 09:19
  • hello @KunLun..... its not working, not opening any tab for the chrome webdriver browser. – Markus nuan Sep 01 '20 at 09:25

0 Answers0