title: Java WebDriver: How can I obtain an instance of a Coordinates class?
body: <p>I am trying to automate a GWT web app and standard clicks on a button don't work.
  Therefore, I am simulating mouse events instead.
  The code examples found online:</p>
  
  <pre><code>Mouse mouse = ((HasInputDevices)driver).getMouse();
  mouse.mouseDown((Coordinates)myButton.getLocation());
  mouse.mouseUp((Coordinates)myButton.getLocation());
  </code></pre>
  
  <p>But then I get:</p>
  
  <pre><code>Exception in thread "main" java.lang.ClassCastException: Point cannot be cast to Coordinates
  </code></pre>
  
  <p>How can I obtain a valid instance of a Coordinates object?</p>