Package org.openqa.selenium

Examples of org.openqa.selenium.Dimension


        wiser.setPort(smtpPort);
        wiser.start();

        setDriver(new ChromeDriver());
        getDriver().manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
        getDriver().manage().window().setSize(new Dimension(1024, 900));
    }
View Full Code Here


        int initialHeight = menu.getSize().getHeight();
        int y = menu.getLocation().getY();

        closeContextMenu();

        Dimension size = getDriver().manage().window().getSize();

        int windowHeight = y + initialHeight - 10;
        if (isElementPresent(By.className("v-ff"))) {
            // FF does something wrong with window height
            windowHeight = y + initialHeight + 90;
        } else if (isElementPresent(By.className("v-ch"))) {
            // Chrome does something wrong with window height
            windowHeight = y + initialHeight + 20;
        }
        getDriver().manage().window()
                .setSize(new Dimension(size.getWidth(), windowHeight));

        menu = openContextMenu();
        int height = menu.getSize().getHeight();

        Assert.assertEquals("Context menu height has been changed after "
View Full Code Here

        int initialHeight = menu.getSize().getHeight();
        int y = menu.getLocation().getY();

        closeContextMenu();

        Dimension size = getDriver().manage().window().getSize();

        int windowHeight = initialHeight - 10;
        if (isElementPresent(By.className("v-ch"))) {
            // Chrome does something wrong with window height
            windowHeight = y + initialHeight;
        }
        getDriver().manage().window()
                .setSize(new Dimension(size.getWidth(), windowHeight));

        menu = openContextMenu();
        int height = menu.getSize().getHeight();

        Assert.assertTrue(
                "Context menu height has not been descreased after "
                        + "window height update to value lower than context menu initial height",
                initialHeight > height);
        closeContextMenu();

        getDriver().manage().window()
                .setSize(new Dimension(size.getWidth(), size.getHeight()));
        menu = openContextMenu();
        height = menu.getSize().getHeight();
        Assert.assertEquals("Context menu height has not been reset after "
                + "window height reset", initialHeight, height);
    }
View Full Code Here

        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

    @Test
    public void windowScrollTest() throws IOException, InterruptedException {
        TestBenchElement panelScrollable = (TestBenchElement) getDriver()
                .findElement(By.className("v-panel-content"));
        Dimension panelScrollableSize = panelScrollable.getSize();

        WebElement verticalLayout = panelScrollable.findElement(By
                .className("v-verticallayout"));
        Dimension verticalLayoutSize = verticalLayout.getSize();

        panelScrollable.scroll(verticalLayoutSize.height);

        WebElement button = verticalLayout
                .findElement(By.className("v-button"));
View Full Code Here

        assertNoErrorNotification();

    }

    private void openPopup() throws InterruptedException {
        Dimension size = getInput().getSize();
        new Actions(getDriver()).moveToElement(getInput(), 0, 0)
                .moveByOffset(size.getWidth() + 5, size.getHeight() / 2)
                .click();
        // This fails in Opera for some weird reason
        // getDriver().findElement(By.className("v-datefield-button")).click();
    }
View Full Code Here

        assertTrue("The context menu was not rendered on the correct position! The difference is: " + result, result >= 0
            && result < TOLERANCE);
    }

    public double getTargetWidth(WebElement target) {
        Dimension dimension = target.getSize();

        return dimension.getWidth();
    }
View Full Code Here

        return dimension.getWidth();
    }

    public double getTargetHeight(WebElement target) {
        Dimension dimension = target.getSize();

        return dimension.getHeight();
    }
View Full Code Here

        $(ButtonElement.class).first().click();
        assertShadowSize();
    }

    private void assertShadowSize() {
        Dimension shadowSize = getPopupShadow().getSize();
        Dimension layoutSize = $(VerticalLayoutElement.class).id("content-vl")
                .getSize();

        assertThat(shadowSize.height, is(greaterThan(layoutSize.height)));
        assertThat(shadowSize.height, is(lessThan(layoutSize.height + 10)));
        assertThat(shadowSize.width, is(greaterThan(layoutSize.width)));
View Full Code Here

    Map<String, Object> size = executor.execute(request);

    Long height = (Long) size.get("height");
    Long width = (Long) size.get("width");

    return new Dimension(width.intValue(), height.intValue());
  }
View Full Code Here

TOP

Related Classes of org.openqa.selenium.Dimension

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.