I'm writing auto-tests for an openLayers web application (similar to Google Maps), trying to get it to click and drag to pan the map, as any user normally would. After many attempts and research, I still cannot get it to pan automagically. This is using a Chrome driver.
My code seems correct because I tried starting the tests, then quickly switching to a notepad window full of text, and voila, the text gets highlighted.
Robot robot = new Robot()
robot.mouseMove(501,501) // starting cursor position, somewhere near the middle of the map
robot.mousePress(InputEvent.BUTTON1_DOWN_MASK)
// robot.delay(1000) // tried this but it made no difference
Thread.sleep(1000)
robot.mouseMove(400,400) // another position, still within the map's frame
robot.mouseRelease(InputEvent.BUTTON1_DOWN_MASK)
Expected results: map pans
Actual results: cursor jumps location but the map does not move
No error messages
Update: If I move the mouse cursor slightly over the map whist the test is running, the panning occurs as expected.