I would like to simulate a user pressing shift-enter in a text area. Here is the code I am working with:
var driver = new FirefoxDriver();
driver.Navigate().GoToUrl("http://pagewithtextarea");
var textarea = driver.FindElement(By.Id("myTextArea"));
//Send text
textarea.SendKeys("hello world!");
If I want to simulate pressing the enter button I can say:
textarea.SendKeys(Keys.Enter);
How could I simulate pressing shift and enter at the same time?
Simpler than I expected. Since SendKeys takes a string, and the static constants on Keys are all strings they can simply be concatenated together like this: