Skip to main content

Sap Driver Window

Sap Driver Window

Current window object can be retrieved from driver using the method:

Window window = driver.getActiveWindow();


driver.getActiveWindow().maximize();

((SapWindow) driver.getActiveWindow()).focus();

Dimension windowDimension = driver.getActiveWindow().getSize();

Point windowPosition = driver.getActiveWindow().getPosition();

Focus

Calling of this method is focusing on current window.

public void click();

Get Size

Returns the Dimension object with the "width" and "height" properties

System.out.println("Current window size is: " + windowDimension.getWidth() + "x" + windowDimension.getHeight());

Get Position

Returns the current position of the window on screen. The value is returned as "Point" object with "x" and "y" properties.

System.out.println("Current window position is: " + windowPosition.getX() + "x" + windowPosition.getY());