title: Difference between SendKeys() and Keydown() in Selenium
body: <p>I am using Actions class to do the C# selenium automation testing for FireFox Driver. </p>
  
  <p>I am testing the Auto-Save textarea (click the textarea to make the content editable, and change anything to click anywhere outside / click tab to auto-save the text content).</p>
  
  <p>Initially I use the following Code 1, it only do the "Control+a" action but it does not do the rest: </p>
  
  <pre><code>actions = new Actions(this._driver);
  actions.MoveToElement(element);
  actions.SendKeys(Keys.Control + 'a').Build().Perform();
  actions.SendKeys(Keys.Backspace).Build().Perform();
  actions.SendKeys("new input").SendKeys(Keys.Tab).Build().Perform();
  </code></pre>
  
  <p>Then I changed it to the following code 2, it works.</p>
  
  <pre><code>actions = new Actions(this._driver);
  actions.MoveToElement(element);
  actions.KeyDown(Keys.Control).SendKeys("a").KeyUp(Keys.Control).Build().Perform();
  actions.SendKeys(Keys.Backspace).Build().Perform();
  actions.SendKeys("new input").SendKeys(Keys.Tab).Build().Perform();
  </code></pre>
  
  <p>It looks the 2 codes are same, but they have different behaviours, really appreciated if anyone can help to point out why they have different behaviours?</p>