File tree 2 files changed +7
-2
lines changed
java/client/src/org/openqa/selenium/remote
2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -333,7 +333,7 @@ public boolean isDisplayed() {
333
333
334
334
@ SuppressWarnings ({"unchecked" })
335
335
public Point getLocation () {
336
- Response response = execute (DriverCommand .GET_ELEMENT_RECT , ImmutableMap .of ("id" , id ));
336
+ Response response = execute (DriverCommand .GET_ELEMENT_LOCATION , ImmutableMap .of ("id" , id ));
337
337
Map <String , Object > rawPoint = (Map <String , Object >) response .getValue ();
338
338
int x = ((Number ) rawPoint .get ("x" )).intValue ();
339
339
int y = ((Number ) rawPoint .get ("y" )).intValue ();
@@ -342,7 +342,7 @@ public Point getLocation() {
342
342
343
343
@ SuppressWarnings ({"unchecked" })
344
344
public Dimension getSize () {
345
- Response response = execute (DriverCommand .GET_ELEMENT_RECT , ImmutableMap .of ("id" , id ));
345
+ Response response = execute (DriverCommand .GET_ELEMENT_SIZE , ImmutableMap .of ("id" , id ));
346
346
Map <String , Object > rawSize = (Map <String , Object >) response .getValue ();
347
347
int width = ((Number ) rawSize .get ("width" )).intValue ();
348
348
int height = ((Number ) rawSize .get ("height" )).intValue ();
Original file line number Diff line number Diff line change 30
30
import static org .openqa .selenium .remote .DriverCommand .GET_CURRENT_WINDOW_POSITION ;
31
31
import static org .openqa .selenium .remote .DriverCommand .GET_CURRENT_WINDOW_SIZE ;
32
32
import static org .openqa .selenium .remote .DriverCommand .GET_ELEMENT_ATTRIBUTE ;
33
+ import static org .openqa .selenium .remote .DriverCommand .GET_ELEMENT_LOCATION ;
33
34
import static org .openqa .selenium .remote .DriverCommand .GET_ELEMENT_LOCATION_ONCE_SCROLLED_INTO_VIEW ;
35
+ import static org .openqa .selenium .remote .DriverCommand .GET_ELEMENT_RECT ;
36
+ import static org .openqa .selenium .remote .DriverCommand .GET_ELEMENT_SIZE ;
34
37
import static org .openqa .selenium .remote .DriverCommand .GET_PAGE_SOURCE ;
35
38
import static org .openqa .selenium .remote .DriverCommand .GET_WINDOW_HANDLES ;
36
39
import static org .openqa .selenium .remote .DriverCommand .IS_ELEMENT_DISPLAYED ;
@@ -63,7 +66,9 @@ public class W3CHttpCommandCodec extends AbstractHttpCommandCodec {
63
66
64
67
public W3CHttpCommandCodec () {
65
68
alias (GET_ELEMENT_ATTRIBUTE , EXECUTE_SCRIPT );
69
+ alias (GET_ELEMENT_LOCATION , GET_ELEMENT_RECT );
66
70
alias (GET_ELEMENT_LOCATION_ONCE_SCROLLED_INTO_VIEW , EXECUTE_SCRIPT );
71
+ alias (GET_ELEMENT_SIZE , GET_ELEMENT_RECT );
67
72
alias (IS_ELEMENT_DISPLAYED , EXECUTE_SCRIPT );
68
73
alias (SUBMIT_ELEMENT , EXECUTE_SCRIPT );
69
74
You can’t perform that action at this time.
0 commit comments