title: How to use OpenLayers DrawFeature with Selenium WebDriver in Java (double click issue)?
body: <p>I am testing a GIS API that is based on OpenLayers. I use Selenium WebDriver to perform the tests. I am now trying to test the OpenLayers.DrawFeature. It works fine when drawing points, which require a single click. But for lines and polygons it doesn't.</p>
  <p>Line and polygon drawing requires a double click to finish drawing the shape. But, the &quot;doubleClick()&quot; method from Selenium WebDriver doe not seem to work.</p>
  <p>It is a work task, so I can't paste the whole code, but here is what I think is the crucial part:</p>
  <pre><code>driver = new ChromeDriver();
  Global.initWithCookies(driver);
  
  // Gets the button to select a shape to draw
  WebElement el = driver.findElement(By.id(Menu.idOfDrawModesBtn()));
  // Creates an action
  Actions act = new Actions(driver);
  // Moves the cursor to the element
  act.moveToElement(el).perform();
  // Gets the button to draw a polygon
  driver.findElement(By.id(Menu.idOfDrawModePolygonBtn())).click();
  // Gets the map element
  el = driver.findElement(By.id(Global.idOfMapDiv()));
  // Moves the cursor to the element
  act.moveToElement(el).perform();
  
  // First click at the center of the map
  act.click().perform();
  // Moves to 2nd location
  act.moveByOffset(100, 10).perform();
  // 2nd click creates the 2nd vertex of the polygon
  act.click().perform();
  // Moves to 2nd location
  act.moveByOffset(200, -200).perform();
  /* Double click creates the 3rd vertex of the polygon
      AND should finish the drawing */
  act.doubleClick().perform();
  
  driver.close();
  </code></pre>
  <p>As you can see here, the polygon is not drawn yet, because the double click didn't work:</p>
  <p><img src="https://i.stack.imgur.com/o1QLq.png" alt="without_double_click" /></p>
  <p>This is what it should look like, if the double click worked:</p>
  <p><img src="https://i.stack.imgur.com/a8b5b.png" alt="with_double_click" /></p>