public Point getCenter() {
        Point upperLeft = this.getLocation();
        Dimension dimensions = this.getSize();
        return new Point(upperLeft.getX() + dimensions.getWidth() / 2,
            upperLeft.getY() + dimensions.getHeight() / 2);
    }
public Point getCenter ( ) { Point upperLeft = this . getLocation ( ) ; Dimension dimensions = this . getSize ( ) ; return new Point ( upperLeft . getX ( ) + dimensions . getWidth ( ) / 2 , upperLeft . getY ( ) + dimensions . getHeight ( ) / 2 ) ; }
Method returns central coordinates of an element.
@return The instance of the {@link org.openqa.selenium.Point}