@Override public Location getLocationInScreenshot(Location location, CoordinatesType coordinatesType) throws OutOfBoundsException { location = convertLocation(location, coordinatesType, CoordinatesType.SCREENSHOT_AS_IS); // Making sure it's within the screenshot bounds if (!frameWindow.contains(location)) { throw new OutOfBoundsException(String.format( "Location %s ('%s') is not visible in screenshot!", location, coordinatesType)); } return location; }
@Override public Location getLocationInScreenshot(Location location, CoordinatesType coordinatesType) throws OutOfBoundsException { ArgumentGuard.notNull(location, "location"); ArgumentGuard.notNull(coordinatesType, "coordinatesType"); location = convertLocation(location, coordinatesType, CoordinatesType.CONTEXT_RELATIVE); if (!bounds.contains(location)) { throw new OutOfBoundsException(String.format( "Location %s ('%s') is not visible in screenshot!", location, coordinatesType)); } return convertLocation(location, CoordinatesType.CONTEXT_RELATIVE, CoordinatesType.SCREENSHOT_AS_IS); }
/** * Get the location in the screenshot. * * @param location The location as coordinates inside the current frame. * @param coordinatesType The coordinates type of {@code location}. * @return The location in the screenshot. * @throws OutOfBoundsException */ @Override public Location getLocationInScreenshot(Location location, CoordinatesType coordinatesType) throws OutOfBoundsException { ArgumentGuard.notNull(location, "location"); ArgumentGuard.notNull(coordinatesType, "coordinatesType"); location = convertLocation(location, coordinatesType, CoordinatesType.CONTEXT_RELATIVE); if (!bounds.contains(location)) { throw new OutOfBoundsException(String.format( "Location %s ('%s') is not visible in screenshot!", location, coordinatesType)); } return convertLocation(location, CoordinatesType.CONTEXT_RELATIVE, CoordinatesType.SCREENSHOT_AS_IS); }
if (!viewportBounds.contains(elementBounds)) { ensureFrameVisible();