Package org.openqa.selenium.interactions

Examples of org.openqa.selenium.interactions.Actions


    }

    @Test
    public void testStalenessAndActionsOnWebElement2() {
        WebElement inStale = browser.findElement(By.className("stale")).findElement(By.className("in-stale"));
        Action action = new Actions(browser).moveToElement(inStale).build();
        makeStale.click();
        action.perform();
    }
View Full Code Here


        return interactions;
    }

    @Override
    public void close() {
        new Actions(driver).moveToElement(advanced().getRootElement()).perform();
        Graphene.waitModel().until().element(advanced().getCloseIconElement()).is().visible();
        final List<WebElement> messages = driver.findElements(By.cssSelector("div.rf-ntf-cnt"));
        final int sizeBefore = messages.size();
        new Actions(driver).click(advanced().getCloseIconElement()).perform();
        Graphene.waitModel().withMessage("The message did not disappear.").until(new ExpectedCondition<Boolean>() {
            @Override
            public Boolean apply(WebDriver input) {
                return messages.size() == (sizeBefore - 1);
            }
View Full Code Here

    public void slideToValue(double n) {
        advanced().dragHandleToPointInTrace((int) (n * advanced().getWidth()));
    }

    protected void scrollToView() {
        new Actions(browser).moveToElement(advanced().getRootElement()).perform();
    }
View Full Code Here

                "Cannot slide outside the trace.");
            if (!Utils.isVisible(advanced().getRootElement())) {
                throw new RuntimeException("Trace is not visible.");
            }
            scrollToView();
            Actions actions = new Actions(browser).clickAndHold(advanced().getHandleElement());
            actions.moveToElement(advanced().getRootElement(), pixelInTrace, 0);
            actions.release(advanced().getHandleElement()).build().perform();
        }
View Full Code Here

public abstract class AbstractConfirmOrCancel implements ConfirmOrCancel {

    @Override
    public void confirm() {
        new Actions(getBrowser()).sendKeys(Keys.chord(Keys.CONTROL, Keys.RETURN)).perform();
        waitAfterConfirmOrCancel();
    }
View Full Code Here

    public class AdvancedTextInputInteractions {

        public TextInputComponentImpl clear(ClearType clearType) {
            int valueLength = root.getAttribute("value").length();
            Actions builder = new Actions(driver);
            switch (clearType) {
                case BACKSPACE:
                    for (int i = 0; i < valueLength; i++) {
                    builder.sendKeys(root, Keys.BACK_SPACE);
                }
                    builder.build().perform();
                    break;
                case DELETE:
                    String ctrlADel = Keys.chord(Keys.CONTROL, "a", Keys.DELETE);
                    builder.sendKeys(root, ctrlADel);
                    builder.build().perform();
                    break;
                case ESCAPE_SQ:
                    StringBuilder sb = new StringBuilder();
                    for (int i = 0; i < valueLength; i++) {
                        sb.append("\b");
View Full Code Here

        return getHeaderCell(column).findElement(
                By.className("v-table-resizer"));
    }

    private void resizeColumn(int column, int by) throws InterruptedException {
        new Actions(driver).clickAndHold(getColumnResizer(column))
                .moveByOffset(by, 0).perform();
        sleep(2000);
        new Actions(driver).release().perform();
    }
View Full Code Here

    private void moveRow(int from, int to) {
        List<WebElement> rows = getRows();
        List<WebElement> cellContents = getCellContents(rows.get(from));

        new Actions(getDriver()).moveToElement(cellContents.get(2))
                .clickAndHold().moveToElement(rows.get(to)).release().perform();
    }
View Full Code Here

                "original value not found, wrong cell or contents (1st column of the 2nd row expected)",
                "Teppo", cell_1_0.getText());

        // double-click to edit cell contents
        cell_1_0.click();
        new Actions(getDriver()).doubleClick(cell_1_0).build().perform();
        sleep(100);

        // fetch the updated cell
        WebElement textField = table.getCell(1, 0).findElement(
                By.className("v-textfield"));
View Full Code Here

  public void move_by(int x, int y) {
    takeScreenshot();
    Point current_location = getLocation();
    action("Current position of element '" + current_location + "', Moving by (x, y) = (" + x + ", " + y + ")");
   
    Actions drag = new Actions(browser.driver());
    try {
      drag.dragAndDropBy(_nativeWebElement(), x, y).build().perform();
      Point new_location = getLocation();
      action("New position of element '" + new_location + "', Moved by (x, y) = (" + x + ", " + y + ")");
    } catch (org.openqa.selenium.interactions.MoveTargetOutOfBoundsException mtoobe) {
      error("Cannot move element '" + current_location + "', to (x, y) = (" + x + ", " + y + "), got org.openqa.selenium.interactions.MoveTargetOutOfBoundsException");
    }
View Full Code Here

TOP

Related Classes of org.openqa.selenium.interactions.Actions

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.