@@ -49,9 +49,15 @@ public class MoveRobot extends TestFxAdapter {
4949 @ ArgumentNames ({ "locator" , "motion=DIRECT" })
5050 public FxRobotInterface moveTo (Object locator , String motion ) {
5151 RobotLog .info ("Moving to target \" " + locator + "\" using motion: \" " + getMotion (motion ) + "\" " );
52-
53- if ( locator instanceof String )
52+ if ( locator instanceof String ) {
53+ String originalLocator = ( String ) locator ;
5454 locator = new Finder ().find ((String ) locator );
55+ if (locator ==null ) {
56+ throw new JavaFXLibraryNonFatalException ("Unable to move as locator \" " + originalLocator + "\" not found!" );
57+ } else {
58+ RobotLog .info ("Locator at this point: " + locator );
59+ }
60+ }
5561
5662 Method method = MethodUtils .getMatchingAccessibleMethod (robot .getClass (), "moveTo" , locator .getClass (), Motion .class );
5763
@@ -73,7 +79,7 @@ public FxRobotInterface moveTo(Object locator, String motion) {
7379 public FxRobotInterface moveBy (int x , int y , String motion ) {
7480 try {
7581 RobotLog .info ("Moving by [" + x + ", " + y + "] using motion: \" " + motion + "\" " );
76- return robot .moveBy (( double ) x , ( double ) y , HelperFunctions .getMotion (motion ));
82+ return robot .moveBy (x , y , HelperFunctions .getMotion (motion ));
7783 } catch (Exception e ) {
7884 if (e instanceof JavaFXLibraryNonFatalException )
7985 throw e ;
@@ -94,7 +100,7 @@ public FxRobotInterface moveBy(int x, int y, String motion) {
94100 public FxRobotInterface moveToCoordinates (int x , int y , String motion ) {
95101 try {
96102 RobotLog .info ("Moving to coordinates: [" + x + ", " + y + "] using motion: \" " + motion + "\" " );
97- return robot .moveTo (( double ) x , ( double ) y , HelperFunctions .getMotion (motion ));
103+ return robot .moveTo (x , y , HelperFunctions .getMotion (motion ));
98104 } catch (Exception e ) {
99105 if (e instanceof JavaFXLibraryNonFatalException )
100106 throw e ;
0 commit comments