-1

I have created bulk whatsapp message sender application into that I want to send multiline text message. but in whatsapp web when I tried to press enter it sends the message directly I want it to press shift + enter after some content in message to send multiline message.

  • `Keys.SHIFT`, `Keys.RETURN` ? – furas Mar 31 '22 at 06:47
  • This would help you: [SO link](https://stackoverflow.com/questions/61838269/how-can-i-get-selenium-to-get-a-keyboard-press-of-shift-enter-at-the-same-time) – Anand Gautam Mar 31 '22 at 09:07
  • Does this answer your question? [How to send several keys in WebDriver with Python?](https://stackoverflow.com/questions/23206174/how-to-send-several-keys-in-webdriver-with-python) – JAdel Apr 01 '22 at 10:54

2 Answers2

0

This question was already answered here.

If you want to press multiple keys at the same time, you can do:

from selenium.webdriver.common.keys import Keys

driver.find_element("Your Element").send_keys(Keys.SHIFT, Keys.ENTER)
JAdel
  • 1,309
  • 1
  • 7
  • 24
0

For python

from selenium.webdriver.common.keys import Keys
from selenium.webdriver import ActionChains

ActionChains(driver).key_down(Keys.SHIFT).key_down(Keys.ENTER).key_up(Keys.SHIFT).key_up(Keys.ENTER).perform()

Refer to this answer

Yingxu He
  • 130
  • 1
  • 6