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:
Mouse mouse = ((HasInputDevices)driver).getMouse();
mouse.mouseDown((Coordinates)myButton.getLocation());
mouse.mouseUp((Coordinates)myButton.getLocation());
But then I get:
Exception in thread "main" java.lang.ClassCastException: Point cannot be cast to Coordinates
How can I obtain a valid instance of a Coordinates object?
This is how you do it..
Locatable button = (Locatable) myButton;
Mouse mouse = ((HasInputDevices)driver).getMouse();
mouse.mouseDown(button.getCoordinates());
mouse.mouseUp(button.getCoordinates());
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.