Package org.openqa.selenium.interactions.internal

Examples of org.openqa.selenium.interactions.internal.Coordinates


        // There is some bug in Selenium. Can't move window using header
        // need use footer instead.
        WebElement wnd1Footer = wnd
                .findElement(By.className("v-window-footer"));
        Point startLoc = wnd.getLocation();
        Coordinates footerCoordinates = ((Locatable) wnd1Footer)
                .getCoordinates();
        Mouse mouse = ((HasInputDevices) getDriver()).getMouse();
        mouse.mouseDown(footerCoordinates);
        mouse.mouseMove(footerCoordinates, 200, 200);
        mouse.mouseUp(footerCoordinates);
View Full Code Here


    }

    @Test
    public void tooltipsHaveQuickOpenDelay() throws InterruptedException {
        openTestURL();
        Coordinates button0Coordinates = getButtonCoordinates("Button 0");
        Coordinates button1Coordinates = getButtonCoordinates("Button 1");

        Mouse mouse = getMouse();
        mouse.mouseMove(button0Coordinates, 10, 10);
        sleep(1000);
        assertThat(getTooltipElement().getLocation().x, is(greaterThan(0)));

        mouse.mouseMove(button1Coordinates, 10, 10);
        assertThat(getTooltipElement().getLocation().x, is(lessThan(-1000)));

        sleep(1000);
        assertThat(getTooltipElement().getLocation().x,
                is(greaterThan(button1Coordinates.onPage().x)));
    }
View Full Code Here

    private ButtonElement getButtonElement() {
        return $(ButtonElement.class).first();
    }

    private void moveMouseToButtonBottomRightCorner(Mouse mouse) {
        Coordinates buttonCoordinates = getButtonCoordinates();
        Dimension buttonDimensions = getButtonDimensions();

        mouse.mouseMove(buttonCoordinates, buttonDimensions.getWidth() - 1,
                buttonDimensions.getHeight() - 1);
    }
View Full Code Here

        mouse.mouseMove(buttonCoordinates, buttonDimensions.getWidth() - 1,
                buttonDimensions.getHeight() - 1);
    }

    private void moveMouseToButtonUpperLeftCorner(Mouse mouse) {
        Coordinates buttonCoordinates = getButtonCoordinates();

        mouse.mouseMove(buttonCoordinates, 0, 0);
    }
View Full Code Here

                By.className("v-captiontext"));

        assertEquals("inner layout", caption.getText());

        // Hover over the caption
        Coordinates coords = ((Locatable) caption).getCoordinates();
        ((HasInputDevices) getDriver()).getMouse().mouseMove(coords);
        sleep(1000);

        String selector = "Root/VNotification[0]";
        try {
View Full Code Here

        assertThat(errorMessage.isDisplayed(), is(false));

    }

    private void showTooltip(int index) {
        Coordinates elementCoordinates = ((Locatable) getTab(index))
                .getCoordinates();
        Mouse mouse = ((HasInputDevices) getDriver()).getMouse();
        mouse.mouseMove(elementCoordinates);
    }
View Full Code Here

        tooltipText = driver.findElement(By.className("v-tooltip")).getText();
        assertEquals(tooltipText, "Horizontal layout tooltip");
    }

    private void showTooltip(WebElement element) {
        Coordinates elementCoordinates = ((Locatable) element).getCoordinates();
        Mouse mouse = ((HasInputDevices) getDriver()).getMouse();
        mouse.mouseMove(elementCoordinates);
    }
View Full Code Here

    @Test
    public void testTooltipLocation() {
        openTestURL();
        Mouse mouse = ((HasInputDevices) getDriver()).getMouse();
        WebElement menu = $(MenuBarElement.class).first().getWrappedElement();
        Coordinates menuLocation = ((Locatable) menu).getCoordinates();
        mouse.click(menuLocation);
        mouse.mouseMove(menuLocation, 5, -40);
        WebElement tooltip = getTooltipElement();
        assertThat(tooltip.getLocation().x, is(lessThan(menuLocation.onPage().x
                - tooltip.getSize().getWidth())));

    }
View Full Code Here

    @Test
    public void testToolTipDelay() throws InterruptedException {
        openTestURL();

        Coordinates elementCoordinates = getCoordinates($(MenuBarElement.class)
                .first());

        Mouse mouse = ((HasInputDevices) getDriver()).getMouse();

        mouse.click(elementCoordinates);
        mouse.mouseMove(elementCoordinates, 15, 40);

        sleep(1000);

        assertThat(getTooltipElement().getLocation().getX(),
                is(lessThan(-1000)));

        sleep(3000);

        assertThat(getTooltipElement().getLocation().getX(),
                is(greaterThan(elementCoordinates.onPage().getX())));
        assertThat(getTooltipElement().getText(), is("TOOLTIP 1"));
    }
View Full Code Here

        if (isFirefox(element) || isiOs(element)) {
            location = element.getLocation();
        } else {
            try {
                Coordinates coordinates = ((RemoteWebElement) element).getCoordinates();
                location = coordinates.getLocationOnScreen();
            } catch (Exception e) {
                location = element.getLocation();
            }
        }
        return location;
View Full Code Here

TOP

Related Classes of org.openqa.selenium.interactions.internal.Coordinates

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.