File tree Expand file tree Collapse file tree
java/client/src/org/openqa/selenium/remote Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -333,7 +333,7 @@ public boolean isDisplayed() {
333333
334334 @ SuppressWarnings ({"unchecked" })
335335 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 ));
337337 Map <String , Object > rawPoint = (Map <String , Object >) response .getValue ();
338338 int x = ((Number ) rawPoint .get ("x" )).intValue ();
339339 int y = ((Number ) rawPoint .get ("y" )).intValue ();
@@ -342,7 +342,7 @@ public Point getLocation() {
342342
343343 @ SuppressWarnings ({"unchecked" })
344344 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 ));
346346 Map <String , Object > rawSize = (Map <String , Object >) response .getValue ();
347347 int width = ((Number ) rawSize .get ("width" )).intValue ();
348348 int height = ((Number ) rawSize .get ("height" )).intValue ();
Original file line number Diff line number Diff line change 3030import static org .openqa .selenium .remote .DriverCommand .GET_CURRENT_WINDOW_POSITION ;
3131import static org .openqa .selenium .remote .DriverCommand .GET_CURRENT_WINDOW_SIZE ;
3232import static org .openqa .selenium .remote .DriverCommand .GET_ELEMENT_ATTRIBUTE ;
33+ import static org .openqa .selenium .remote .DriverCommand .GET_ELEMENT_LOCATION ;
3334import 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 ;
3437import static org .openqa .selenium .remote .DriverCommand .GET_PAGE_SOURCE ;
3538import static org .openqa .selenium .remote .DriverCommand .GET_WINDOW_HANDLES ;
3639import static org .openqa .selenium .remote .DriverCommand .IS_ELEMENT_DISPLAYED ;
@@ -63,7 +66,9 @@ public class W3CHttpCommandCodec extends AbstractHttpCommandCodec {
6366
6467 public W3CHttpCommandCodec () {
6568 alias (GET_ELEMENT_ATTRIBUTE , EXECUTE_SCRIPT );
69+ alias (GET_ELEMENT_LOCATION , GET_ELEMENT_RECT );
6670 alias (GET_ELEMENT_LOCATION_ONCE_SCROLLED_INTO_VIEW , EXECUTE_SCRIPT );
71+ alias (GET_ELEMENT_SIZE , GET_ELEMENT_RECT );
6772 alias (IS_ELEMENT_DISPLAYED , EXECUTE_SCRIPT );
6873 alias (SUBMIT_ELEMENT , EXECUTE_SCRIPT );
6974
You can’t perform that action at this time.
0 commit comments