protected Coordinates getActionLocation() { if (where == null) { return null; } return where.getCoordinates(); }
@Override public Coordinates getCoordinates() { return locatable.getCoordinates(); }
@Override public Coordinates getCoordinates() { return locatable.getCoordinates(); }
protected Coordinates getActionLocation() { return (where == null) ? null : where.getCoordinates(); } }
protected Optional<WebElement> getTargetElement() { if (where == null) { return Optional.empty(); } if (!(where.getCoordinates().getAuxiliary() instanceof WebElement)) { throw new IllegalStateException(String.format( "%s: Unable to find element to use: %s", this, where.getCoordinates())); } return Optional.of((WebElement) where.getCoordinates().getAuxiliary()); } }
@Override public Coordinates getCoordinates() { return ((Locatable) getElement()).getCoordinates(); } }
@Override public Coordinates getCoordinates() { webDriver.ensureSwitch(); return ((Locatable) webElement).getCoordinates(); }
protected void focusOnElement() { if (where != null) { mouse.click(where.getCoordinates()); } }
public Coordinates getCoordinates() { return ((Locatable)getWebElement()).getCoordinates(); }
public Coordinates getCoordinates() { return ((Locatable)getWebElement()).getCoordinates(); }
public Coordinates getCoordinates() { return ((Locatable)getWebElement()).getCoordinates(); }
public Coordinates getCoordinates() { return ((Locatable)getWebElement()).getCoordinates(); }
@Override public Coordinates getCoordinates() { if (!isLocatable()) { throw new GaleniumException("Does not implement Locatable: " + getDelegatee()); } return ((Locatable)getDelegatee()).getCoordinates(); }
/** /** * Scroll to element (applied only for desktop). * Useful for desktop with React */ public void scrollTo() { if (Configuration.getDriverType().equals(SpecialKeywords.MOBILE)) { LOGGER.debug("scrollTo javascript is unsupported for mobile devices!"); return; } try { Locatable locatableElement = (Locatable) findElement(EXPLICIT_TIMEOUT); // [VD] onScreen should be updated onto onPage as only 2nd one // returns real coordinates without scrolling... read below material // for details // https://groups.google.com/d/msg/selenium-developers/nJR5VnL-3Qs/uqUkXFw4FSwJ // [CB] onPage -> inViewPort // https://code.google.com/p/selenium/source/browse/java/client/src/org/openqa/selenium/remote/RemoteWebElement.java?r=abc64b1df10d5f5d72d11fba37fabf5e85644081 int y = locatableElement.getCoordinates().inViewPort().getY(); int offset = R.CONFIG.getInt("scroll_to_element_y_offset"); ((JavascriptExecutor) getDriver()).executeScript("window.scrollBy(0," + (y - offset) + ");"); } catch (Exception e) { //do nothing } }
private Point getCurrentLocation() { Point inViewPort = null; switcher.switchTo(getFramePath()); try { Dimension size = webElement.getSize(); inViewPort = ((Locatable) webElement).getCoordinates().inViewPort() .moveBy(size.getWidth() / 2, size.getHeight() / 2); } finally { switcher.switchBack(); } return inViewPort; }
private Point getCurrentLocation() { Point inViewPort = null; switcher.switchTo(getFramePath()); try { Dimension size = webElement.getSize(); inViewPort = ((Locatable) webElement).getCoordinates().inViewPort() .moveBy(size.getWidth() / 2, size.getHeight() / 2); } finally { switcher.switchBack(); } return inViewPort; }
protected Point getTouchPoint(Offset offset) { org.openqa.selenium.Point inViewPort = ((Locatable) getFirstElement()).getCoordinates().inViewPort(); Point viewPort = new Point(inViewPort.x, inViewPort.y); Point offsetPoint = offset.offset(getSize()); Point touchPoint = viewPort.moveBy(offsetPoint.x(), offsetPoint.y()); return touchPoint; } }
/** * @return Point in the middle of the drop area. */ @Override public Point getCurrentLocation() { Point inViewPort = null; switcher.switchTo(getFramePath()); try { Dimension size = dropArea.getSize(); inViewPort = ((Locatable) dropArea).getCoordinates().inViewPort() .moveBy(size.getWidth() / 2, size.getHeight() / 2); } finally { switcher.switchBack(); } return inViewPort; }
/** * @return Point in the middle of the drop area. */ @Override public Point getCurrentLocation() { Point inViewPort = null; switcher.switchTo(getFramePath()); try { Dimension size = dropArea.getSize(); inViewPort = ((Locatable) dropArea).getCoordinates().inViewPort() .moveBy(size.getWidth() / 2, size.getHeight() / 2); } finally { switcher.switchBack(); } return inViewPort; }
driver.get(mainPage); driver.switchTo().frame(driver.findElementByTagName("iframe")); driver.getMouse().click(((Locatable) driver.findElement(By.id("iframe-anchor"))).getCoordinates()); driver.getMouse().mouseMove(((Locatable) driver.findElement(By.id("iframe-anchor"))).getCoordinates(), 5, 5); driver.pageWait(); test(HttpServer.previousRequest().get(0).startsWith("GET /iframe.htm?param=fromiframe"));