public ShowViewPage submit() { webDriver().scrollTo(500); ((Locatable) saveButton).getCoordinates().inViewPort(); saveButton.click(); return new ShowViewPage( seleniumContext, domainName, getItemId() ).get(); }
if (element instanceof Locatable) { Locatable hoverItem = (Locatable) element; hoverItem.getLocationOnScreenOnceScrolledIntoView(); Mouse mouse = ((HasInputDevices) webDriver).getMouse(); mouse.mouseMove(hoverItem.getCoordinates()); }
@Override public Point getLocationOnScreenOnceScrolledIntoView() { if (element instanceof Locatable) { return ((Locatable) element) .getLocationOnScreenOnceScrolledIntoView(); } throw new UnsupportedOperationException( "Underlying element instance does not support location"); }
public Point getLocationOnScreenOnceScrolledIntoView() { WebElement element = this.getElement(); if ( element instanceof Locatable ) { return ((Locatable) element).getLocationOnScreenOnceScrolledIntoView(); } return null; }
public EditPage editItem(int itemId, String domainName) { final WebElement row = getRowForItem(itemId); ((Locatable) row).getCoordinates().inViewPort(); row.findElement(By.xpath(".//a[@title='Edit']")).click(); return new EditPage(seleniumContext, domainName, itemId).get(); }
@Override public void select( String... optionNames ) { expandOptionList(); webDriver().waitForElementVisible( valueList ); final WebElement optionToSelect = valueList.findElement( By.xpath( String.format( "//li[contains(text(),'%s')]", optionNames[ 0 ] ) ) ); ( ( Locatable ) optionToSelect ).getCoordinates().inViewPort(); optionToSelect.click(); webDriver().waitForElementVisible( getSelectedOption( optionNames[ 0 ] ) ); }
private void addSelection( String option ) { optionList = theField.findElement(By.className("chzn-drop")); expandOptionList(); final WebElement optionToSelect = findOptionByText(optionList, option); assert optionToSelect != null; ( ( Locatable ) optionToSelect ).getCoordinates().inViewPort(); optionToSelect.click(); webDriver().waitForElementVisible( getSelectedOption( option ) ); }
@Override public Coordinates getCoordinates() { if (delegateWebElement != null) { return ((org.openqa.selenium.internal.Locatable) delegateWebElement).getCoordinates(); } else { return ((org.openqa.selenium.internal.Locatable) wrappedWebElement).getCoordinates(); } }
@Override public Coordinates getCoordinates() { if (delegateWebElement != null) { return ((org.openqa.selenium.internal.Locatable) delegateWebElement).getCoordinates(); } else { return ((org.openqa.selenium.internal.Locatable) wrappedWebElement).getCoordinates(); } }
@Override public Coordinates getCoordinates() { if (delegateWebElement != null) { return ((org.openqa.selenium.internal.Locatable) delegateWebElement).getCoordinates(); } else { return ((org.openqa.selenium.internal.Locatable) wrappedWebElement).getCoordinates(); } }
@Override public Coordinates getCoordinates() { if (delegateWebElement != null) { return ((org.openqa.selenium.internal.Locatable) delegateWebElement).getCoordinates(); } else { return ((org.openqa.selenium.internal.Locatable) wrappedWebElement).getCoordinates(); } }
@Override public Coordinates getCoordinates() { return ((Locatable) element).getCoordinates(); }
Locatable hoverItem = (Locatable) driver.findElement(By.xpath("//li[text()='Reklama w Google']")); int y = hoverItem.getCoordinates().getLocationOnScreen().getY(); ((JavascriptExecutor)driver).executeScript("window.scrollBy(0,"+y+");");
@Override public Coordinates getCoordinates() { if (element instanceof Locatable) { return ((Locatable) element).getCoordinates(); } throw new UnsupportedOperationException( "Underlying element instance does not support location"); }
WebElement sourceelement = driver.findElement(By.cssSelector("XXX")); Locatable element = (Locatable)sourceelement ; Point p= element.getCoordinates().inViewPort(); int sourceX=p.getX(); int sourceY=p.getY(); WebElement destelement = driver.findElement(By.cssSelector("YYY")); Locatable elementTarget = (Locatable)destelement; Point Target= elementTarget.getCoordinates().inViewPort(); int targetX=Target.getX(); int targetY=Target.getY();
WebElement source = driver.findElement(By.xpath("//*[@id='column-a']")); Locatable element = (Locatable)source; Point p= element.getCoordinates().inViewPort(); int sourceX=p.getX()+25;(25 can be increased or decreased accordingly) int sourceY=p.getY()+120;(120 can be increased or decreased accordingly)
WebElement target = driver.findElement(By.id("column-b")); Locatable elementTarget = (Locatable)target; Point Target= elementTarget.getCoordinates().inViewPort(); int targetX=Target.getX()+55; int targetY=Target.getY()+150;
//Assume driver initialized properly. WebElement element = driver.findElement(By.id("Element id")); Locatable hoverItem = (Locatable) element; Mouse mouse = ((HasInputDevices) driver).getMouse(); mouse.mouseMove(hoverItem.getCoordinates());
@Override public Coordinates getCoordinates() { // Not checked cast of element, but we knows that every element // is created using with locatable interface. return ((Locatable) getWebElement()).getCoordinates(); }
public void scrollToElement(By by) { Locatable element = (Locatable) selenium.findElement(by); Point p= element.getCoordinates().getLocationOnScreen(); JavascriptExecutor js = (JavascriptExecutor) selenium; js.executeScript("window.scrollTo(" + p.getX() + "," + (p.getY()+150) + ");"); }