Package org.openqa.selenium

Examples of org.openqa.selenium.Dimension


    @Test
    public void performsValidations_ofComponentSpecs() throws IOException {
        openDriverForPage("page-for-component-specs.html");
        PageSpec pageSpec = new PageSpecReader(EMPTY_PROPERTIES, new SeleniumBrowser(driver)).read(getClass().getResource("/specs/components/spec-for-component-test-main.spec").getFile());

        driver.manage().window().setSize(new Dimension(1000, 800));
       
        SeleniumPage page = new SeleniumPage(driver);
       
        TestValidationListener validationListener = new TestValidationListener();
        List<PageSection> pageSections = pageSpec.getSections();
View Full Code Here


        openDriverForPage("page-for-component-specs.html");

        PageSpec pageSpec = new PageSpecReader(EMPTY_PROPERTIES, new SeleniumBrowser(driver))
                .read(getClass().getResource("/specs/components/spec-for-component-test-main.spec").getFile());

        driver.manage().window().setSize(new Dimension(1000, 800));
       
        SeleniumPage page = new SeleniumPage(driver);
       
        TestValidationListener validationListener = new TestValidationListener();
        List<PageSection> pageSections = pageSpec.getSections();
View Full Code Here

    @Override
    public Dimension getSize() {
        if (item.getArea() == null) {
            throw new RuntimeException("Element doesn't have area");
        }
        return new Dimension(item.getArea()[2], item.getArea()[3]);
    }
View Full Code Here

     * @return WebDriver instance.
     */
    public abstract WebDriver newInstance(DriverOptions driverOptions);

    protected void setInitialWindowSize(WebDriver driver, DriverOptions driverOptions) {
        Dimension size;
        if (driverOptions.has(WIDTH) || driverOptions.has(HEIGHT)) {
            int width = NumberUtils.toInt(driverOptions.get(WIDTH), DEFAULT_WIDTH);
            int height = NumberUtils.toInt(driverOptions.get(HEIGHT), DEFAULT_HEIGHT);
            size = new Dimension(width, height);
        } else {
            size = getDefaultWindowSize(driver);
            if (size == null) {
                log.info("Initial window size: system default");
                return;
View Full Code Here

        return driver;
    }

    @Override
    protected Dimension getDefaultWindowSize(WebDriver driver) {
        return new Dimension(DEFAULT_WIDTH, DEFAULT_HEIGHT);
    }
View Full Code Here

        }
    }

    private void safelyResizeWindow(WebDriver driver, int width, int height, DronePoint<?> dronePoint) {
        try {
            driver.manage().window().setSize(new Dimension(width, height));
        } catch (WebDriverException e) {
            logRequestIgnored(driver, width, height, dronePoint);
        } catch (UnsupportedOperationException e) {
            logRequestIgnored(driver, width, height, dronePoint);
        }
View Full Code Here

    }

    @Override
    protected void starting(Description description) {
        driver = new PhantomJSDriver(new DesiredCapabilities());
        driver.manage().window().setSize(new Dimension(1024, 768));
        driver.get(environment.getBaseUrl());
        ((JavascriptExecutor) driver).executeScript(loggingJS);
    }
View Full Code Here

  }

  private OutPutModel createModel() throws IOException {
    ImmutableList<CandidateElementPosition> candidateElements =
            ImmutableList.of(new CandidateElementPosition("a/b/c", new Point(1, 2),
                    new Dimension(3, 4)));
    State state1 =
            new State("state1", "http://example.com/a", candidateElements, 1, 1, 1,
                    ImmutableList.of("failedEvent1"));
    State state2 =
            new State("state2", "http://example.com/b", candidateElements, 1, 1, 1,
View Full Code Here

  }

  private CandidateElementPosition findElement(WebElement webElement,
          CandidateElement element) {
    Point location = webElement.getLocation();
    Dimension size = webElement.getSize();
    CandidateElementPosition renderedCandidateElement =
            new CandidateElementPosition(element.getIdentification().getValue(),
                    location, size);
    if (location.getY() < 0) {
      LOG.warn("Weird positioning {} for {}", webElement.getLocation(),
View Full Code Here

    State state = result.getStates().get("index");
    assertThat(state, is(notNullValue()));
    List<CandidateElementPosition> candidates = state.getCandidateElements();
    assertThat("Number of hovers", candidates, hasSize(3));
    Assume.assumeTrue(resolutionBigEnough);
    assertThat(candidates, hasItem(element(new Point(48, 118), new Dimension(52, 16))));
    assertThat(candidates, hasItem(element(new Point(48, 137), new Dimension(51, 16))));
    assertThat(candidates, hasItem(element(new Point(48, 156), new Dimension(200, 16))));
  }
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.