Here's a snippet of code where the resulting Screen is an anonymous inner class
from ScreenRegion.snapshot:
(This is written in Xtend)
var s = new ScreenRegion
var m = new Mouse
m.click(s.find(new TextTarget('HelloWorldExample.java')).center)
Results in:
Exception in thread "main" java.lang.ClassCastException:
org.sikuli.api.ScreenRegion$1 cannot be cast to
org.sikuli.api.robot.DesktopScreen
at org.sikuli.api.robot.Desktop.getMouse(Desktop.java:111)
at org.sikuli.api.robot.Mouse.getDesktopMouse(Mouse.java:14)
at org.sikuli.api.robot.Mouse.click(Mouse.java:38)
at com.dingrocket.e2e.WebTests.run(WebTests.java:22)
at com.dingrocket.e2e.WebTests.main(WebTests.java:39)
My workaround is to create a new ScreenLocation with the existing one's x and y
but the proper DesktopScreen instance
Original issue reported on code.google.com by jasonpar...@gmail.com on 25 Oct 2012 at 5:54
Original issue reported on code.google.com by
jasonpar...@gmail.com
on 25 Oct 2012 at 5:54