title: How can I reset the Selenium mouse cursor position?
body: <p>I'm testing a javascript web app with some behavior depending on mouse over using Selenium2 WebDriver C# API. I have an extension method that performs a hover on a web element to keep code DRY.</p>
  
  <pre><code>public static void Hover(this IWebElement webElement, IWebDriver driver)
  {
      new Actions(driver).MoveToElement(webElement).Perform();
  }
  </code></pre>
  
  <p>Now I want a method that "resets" the mouse position to some natural default value independent of element.  I call this in TearDown() to keep the driver in a known state after tests. The best I could come up with is</p>
  
  <pre><code>public static void ResetMouseCursor(IWebDriver driver)
  {
      new Actions(driver).MoveByOffset(-9999, -9999).Perform();
  }
  </code></pre>
  
  <p>Which just put's the browser in no-man's land.  Is there a better way to do this?</p>