0

I have used below lines in my script to open new tab. But it is not working now.

body = driver.find_element_by_tag_name("body")
body.send_keys(Keys.CONTROL + 't')

Can someone assist me further.

Browser Used: Chrome

Tester P
  • 167
  • 1
  • 5
  • 15
  • Maybe try send_keys on `driver`, not on `body`. You want to send this message to your browser, not content of the page. – PatNowak Mar 17 '16 at 07:41

1 Answers1

0

Try below:-

body.send_keys(Keys.COMMAND + 't') 

Hope it will help you :)

Shubham Jain
  • 16,610
  • 15
  • 78
  • 125
  • There is one more way to handle keyboard even in python. refer this :- http://stackoverflow.com/questions/860013/is-there-a-python-equivalent-to-javas-awt-robot-class – Shubham Jain Mar 17 '16 at 09:28