@Override public List<Region> getRegions(EyesBase eyesBase, EyesScreenshot screenshot, boolean adjustLocation) { Point locationAsPoint = element.getLocation(); Dimension size = element.getSize(); Location adjustedLocation; if (screenshot != null) { // Element's coordinates are context relative, so we need to convert them first. adjustedLocation = screenshot.getLocationInScreenshot(new Location(locationAsPoint.getX(), locationAsPoint.getY()), CoordinatesType.CONTEXT_RELATIVE); } else { adjustedLocation = new Location(locationAsPoint.getX(), locationAsPoint.getY()); } List<Region> value = new ArrayList<>(); value.add(new Region(adjustedLocation, new RectangleSize(size.getWidth(), size.getHeight()), CoordinatesType.SCREENSHOT_AS_IS)); return value; } }
@Override public List<FloatingMatchSettings> getRegions(EyesBase eyesBase, EyesScreenshot screenshot) { Point locationAsPoint = element.getLocation(); Dimension size = element.getSize(); Location adjustedLocation; if (screenshot != null) { // Element's coordinates are context relative, so we need to convert them first. adjustedLocation = screenshot.getLocationInScreenshot(new Location(locationAsPoint.getX(), locationAsPoint.getY()), CoordinatesType.CONTEXT_RELATIVE); } else { adjustedLocation = new Location(locationAsPoint.getX(), locationAsPoint.getY()); } List<FloatingMatchSettings> value = new ArrayList<>(); value.add(new FloatingMatchSettings(adjustedLocation.getX(), adjustedLocation.getY(), size.getWidth(), size.getHeight(), maxUpOffset, maxDownOffset, maxLeftOffset, maxRightOffset)); return value; } }
@Override public List<Region> getRegions(EyesBase eyesBase, EyesScreenshot screenshot, boolean adjustLocation) { List<WebElement> elements = ((Eyes) eyesBase).getDriver().findElements(this.selector); List<Region> values = new ArrayList<>(elements.size()); for (WebElement element : elements) { Point locationAsPoint = element.getLocation(); Dimension size = element.getSize(); Location adjustedLocation; if (screenshot != null) { // Element's coordinates are context relative, so we need to convert them first. adjustedLocation = screenshot.getLocationInScreenshot( new Location(locationAsPoint.getX(), locationAsPoint.getY()), CoordinatesType.CONTEXT_RELATIVE); } else { adjustedLocation = new Location(locationAsPoint.getX(), locationAsPoint.getY()); } values.add(new Region(adjustedLocation, new RectangleSize(size.getWidth(), size.getHeight()), CoordinatesType.SCREENSHOT_AS_IS)); } return values; } }
@Override public List<FloatingMatchSettings> getRegions(EyesBase eyesBase, EyesScreenshot screenshot) { List<WebElement> elements = ((Eyes) eyesBase).getDriver().findElements(this.selector); List<FloatingMatchSettings> values = new ArrayList<>(); Logger logger = eyesBase.getLogger(); for (WebElement element : elements) { Point locationAsPoint = element.getLocation(); RectangleSize size = EyesSeleniumUtils.getElementVisibleSize(logger, element); Location adjustedLocation; if (screenshot != null) { // Element's coordinates are context relative, so we need to convert them first. adjustedLocation = screenshot.getLocationInScreenshot(new Location(locationAsPoint.getX(), locationAsPoint.getY()), CoordinatesType.CONTEXT_RELATIVE); } else { adjustedLocation = new Location(locationAsPoint.getX(), locationAsPoint.getY()); } values.add(new FloatingMatchSettings(adjustedLocation.getX(), adjustedLocation.getY(), size.getWidth(), size.getHeight(), maxUpOffset, maxDownOffset, maxLeftOffset, maxRightOffset)); } return values; } }
cursorInScreenshot = lastScreenshot.getLocationInScreenshot( cursorInScreenshot, CoordinatesType.CONTEXT_RELATIVE); } catch (OutOfBoundsException e) {
cursorInScreenshot = lastScreenshot.getLocationInScreenshot( cursorInScreenshot, CoordinatesType.CONTEXT_RELATIVE); } catch (OutOfBoundsException e) {
cursorInScreenshot = lastScreenshot.getLocationInScreenshot( cursorInScreenshot, CoordinatesType.CONTEXT_RELATIVE); } catch (OutOfBoundsException e) {