@Override public Void call() throws Exception { Mouse mouse = ((HasInputDevices) getDriver()).getMouse(); Coordinates elementLocation = null; if (elementProvided) { WebElement element = getKnownElements().get(elementId); elementLocation = ((Locatable) element).getCoordinates(); } if (offsetsProvided) { mouse.mouseMove(elementLocation, xOffset, yOffset); } else { mouse.mouseMove(elementLocation); } return null; }
@Override public Coordinates getCoordinates() { if ( webElement instanceof Locatable ) { if ( cachedCoordinates == null ) cachedCoordinates = ( (Locatable) webElement ).getCoordinates(); return cachedCoordinates; } else return null; }
@Override public Coordinates getCoordinates() { try { return ((Locatable)delegate).getCoordinates(); } catch (StaleElementReferenceException e) { reLocateElement(); return getCoordinates(); } }
@Override public Void call() throws Exception { TouchScreen touchScreen = ((HasTouchScreen) getDriver()).getTouch(); WebElement element = getKnownElements().get(elementId); Coordinates elementLocation = ((Locatable) element).getCoordinates(); touchScreen.singleTap(elementLocation); return null; }
@Override public Void call() throws Exception { TouchScreen touchScreen = ((HasTouchScreen) getDriver()).getTouch(); if (elementId != null) { WebElement element = getKnownElements().get(elementId); Coordinates elementLocation = ((Locatable) element).getCoordinates(); touchScreen.flick(elementLocation, xOffset, yOffset, speed); } else { touchScreen.flick(xSpeed, ySpeed); } return null; }
@Override public Void call() throws Exception { TouchScreen touchScreen = ((HasTouchScreen) getDriver()).getTouch(); WebElement element = getKnownElements().get(elementId); Coordinates elementLocation = ((Locatable) element).getCoordinates(); touchScreen.doubleTap(elementLocation); return null; }
@Override public Void call() throws Exception { TouchScreen touchScreen = ((HasTouchScreen) getDriver()).getTouch(); WebElement element = getKnownElements().get(elementId); Coordinates elementLocation = ((Locatable) element).getCoordinates(); touchScreen.longPress(elementLocation); return null; }
@Override public Void call() throws Exception { TouchScreen touchScreen = ((HasTouchScreen) getDriver()).getTouch(); if (elementId != null) { WebElement element = getKnownElements().get(elementId); Coordinates elementLocation = ((Locatable) element).getCoordinates(); touchScreen.scroll(elementLocation, xOffset, yOffset); } else { touchScreen.scroll(xOffset, yOffset); } return null; }
/** * * @param where * @return */ public Element mouseMove(final Coordinates where) { this.logAction("MOUSE MOVE"); new RetryUntilTimeout<Boolean>() { @Override Boolean commandsToRun() { getDriver().getMouse().mouseMove(where); return true; } }.run(); return this; }
/** * * @param where * @param xOffset * @param yOffset * @return */ public Element mouseMove(final Coordinates where, final long xOffset, final long yOffset) { this.logAction("MOUSE MOVE"); new RetryUntilTimeout<Boolean>() { @Override Boolean commandsToRun() { getDriver().getMouse().mouseMove(where, xOffset, yOffset); return true; } }.run(); return this; }
/** * * @return */ @Override public Coordinates getCoordinates() { return new RetryUntilTimeout<Coordinates>() { @Override Coordinates commandsToRun() { return ((Locatable) element).getCoordinates(); } }.run(); }
@Override public boolean equals(Object obj) { if (obj instanceof Coordinates) { Coordinates other = (Coordinates) obj; return Objects.equal(onScreen(), other.onScreen()) && Objects.equal(onPage(), other.onPage()) && Objects.equal(inViewPort(), other.inViewPort()); } return false; }
@Override public Coordinates getCoordinates() { return ((Locatable) getWrappedWebElement()).getCoordinates(); }
@Override public Coordinates getCoordinates() { throw noSuchElementException(); }
@Override public Coordinates getCoordinates() { return locatable.getCoordinates(); }
public Coordinates elementLocation() { ElementLocationProbe location = new ElementLocationProbe(selector); check(location); return location.coordinates(); }
public void moveMouseTo(Coordinates where) { mouse().mouseMove(where); }
public Coordinates coordinates() { return coordinates; }
public static UserGesture mouseMoveTo(Coordinates where) { return robot -> robot.moveMouseTo(where); }
public static UserGesture mouseClickAt(Coordinates where) { return sequenceOf(mouseMoveTo(where), mouseClick()); }
@Override public Coordinates getCoordinates() { AngularWait.waitForRequestsToFinish(); return this.element.getCoordinates(); }
public void ScrollIntoView() { Coordinates thisElementCor = ((Locatable) element).getCoordinates(); thisElementCor.inViewPort(); }
public Coordinates getCoordinates() { return ((Locatable)getWebElement()).getCoordinates(); }
@Override public Coordinates getCoordinates() { return ((Locatable) getWrappedElement()).getCoordinates(); }
@Override public Coordinates getCoordinates() { return pageElement.getCoordinates(); }
@Override public Coordinates getCoordinates() { return ((Locatable) element).getCoordinates(); }
@Override public Coordinates getCoordinates() { webDriver.ensureSwitch(); return ((Locatable) webElement).getCoordinates(); }
@Override public void click(Coordinates where) { ensureWebDriver(); delegateMouse().click(where); }
@Override public void doubleClick(Coordinates where) { ensureWebDriver(); delegateMouse().doubleClick(where); }
@Override public void mouseDown(Coordinates where) { ensureWebDriver(); delegateMouse().mouseDown(where); }
@Override public void mouseUp(Coordinates where) { ensureWebDriver(); delegateMouse().mouseUp(where); }
@Override public void mouseMove(Coordinates where) { ensureWebDriver(); delegateMouse().mouseMove(where); }
@Override public void mouseMove(Coordinates where, long xOffset, long yOffset) { ensureWebDriver(); delegateMouse().mouseMove(where, xOffset, yOffset); }
@Override public void contextClick(Coordinates where) { ensureWebDriver(); delegateMouse().contextClick(where); }
@Override public void click(Coordinates where) { }
@Override public void doubleClick(Coordinates where) { }
@Override public void mouseDown(Coordinates where) { }
@Override public void mouseUp(Coordinates where) { }
@Override public void mouseMove(Coordinates where) { }