title: Correct way to focus an element in Selenium WebDriver using Java
body: <p>What's the equivalent of <code>selenium.focus()</code> for WebDriver? </p>
  
  <pre><code>element.sendKeys("");
  </code></pre>
  
  <p>or</p>
  
  <pre><code>new Actions(driver).moveToElement(element).perform();
  </code></pre>
  
  <p>I have tried both of them and they worked, but which one would always work on all elements? </p>
  
  <p>Which one is the correct way for any elements (such as button, link etc.)? This matters to me because the function will be used on different UI's.</p>