@@ -49,9 +49,15 @@ public class MoveRobot extends TestFxAdapter {
49
49
@ ArgumentNames ({ "locator" , "motion=DIRECT" })
50
50
public FxRobotInterface moveTo (Object locator , String motion ) {
51
51
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 ;
54
54
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
+ }
55
61
56
62
Method method = MethodUtils .getMatchingAccessibleMethod (robot .getClass (), "moveTo" , locator .getClass (), Motion .class );
57
63
@@ -73,7 +79,7 @@ public FxRobotInterface moveTo(Object locator, String motion) {
73
79
public FxRobotInterface moveBy (int x , int y , String motion ) {
74
80
try {
75
81
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 ));
77
83
} catch (Exception e ) {
78
84
if (e instanceof JavaFXLibraryNonFatalException )
79
85
throw e ;
@@ -94,7 +100,7 @@ public FxRobotInterface moveBy(int x, int y, String motion) {
94
100
public FxRobotInterface moveToCoordinates (int x , int y , String motion ) {
95
101
try {
96
102
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 ));
98
104
} catch (Exception e ) {
99
105
if (e instanceof JavaFXLibraryNonFatalException )
100
106
throw e ;
0 commit comments