Package org.openqa.selenium

Examples of org.openqa.selenium.Dimension


    return new Point(0, 0);
  }

  public Dimension getSize() {
    if(is_not_null(_webElement)) {
      Dimension value = _webElement.getSize();
      info("Element '" + super.name() + "' - Dimention is '" + value + "'");
      return value;
    } else {
      info("Element '" + super.name() + "' - has a null _webelement, cannot do getSize()");
    }
    return new Dimension(0, 0);
  }
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

  public String static_info() {
    String info = "";
    Point point = getLocation();
    info += "X = " + point.getX();
    info += ", Y = " + point.getY();
    Dimension dimension = getSize();
    info += ", Height = " + dimension.getHeight();
    info += ", Width = " + dimension.getWidth();
    return info;
  }
View Full Code Here

    return new Point(0, 0);
  }

  public Dimension getSize() {
    if(is_not_null(_webElement)) {
      Dimension value = _webElement.getSize();
      info("Element '" + this.name() + "' - Dimention is '" + value + "'");
      return value;
    } else {
      info("Element '" + this.name() + "' - has a null _webelement, cannot do getSize()");
    }
    return new Dimension(0, 0);
  }
View Full Code Here

    }

    private void safelyResizeWindow(WebDriver driver, int width, int height, Class<?> droneType,
            Class<? extends Annotation> qualifier, Class<?> realInstanceClass) {
        try {
            driver.manage().window().setSize(new Dimension(width, height));
        } catch (WebDriverException e) {
            log.log(Level.WARNING, "Ignoring request to resize browser window to {3}x{4} for {0} @{1}, not supported for {2}",
                    new Object[] { droneType.getSimpleName(), qualifier.getSimpleName(), realInstanceClass.getName(), width,
                            height });
        } catch (UnsupportedOperationException e) {
View Full Code Here

        } catch (FluentExecutionStopped e) {
            assertThat(e.getMessage(), equalTo("AssertionError during invocation of: ?.div().getLocation().shouldNotBe('(1, 1)')"));
            assertThat(e.getCause().getMessage().replace("(after 1 ms)", ""), equalTo("\nExpected: not <(1, 1)>\n     but: was <(1, 1)>"));
        }

        when(we.getSize()).thenReturn(new Dimension(10, 10));
        Dimension size = fwe.getSize().shouldBe(new Dimension(10, 10)).value();
        assertThat(size, equalTo(new Dimension(10, 10)));


        when(we.getSize()).thenReturn(new Dimension(10, 10));
        try {
            fwe.getSize().shouldNotBe(new Dimension(10, 10));
            fail("should have barfed");
        } catch (FluentExecutionStopped e) {
            assertThat(e.getMessage(), equalTo("AssertionError during invocation of: ?.div().getSize().shouldNotBe('(10, 10)')"));
            assertThat(e.getCause().getMessage().replace("(after 1 ms)", ""), equalTo("\nExpected: not <(10, 10)>\n     but: was <(10, 10)>"));
        }

        when(we.getSize()).thenReturn(new Dimension(10, 10));
        try {
            fwe.getSize().shouldBe(new Dimension(20, 20));
            fail("should have barfed");
        } catch (FluentExecutionStopped e) {
            assertThat(e.getMessage(), equalTo("AssertionError during invocation of: ?.div().getSize().shouldBe('(20, 20)')"));
            assertThat(e.getCause().getMessage().replace("(after 1 ms)", ""), equalTo("\nExpected: <(20, 20)>\n     but: was <(10, 10)>"));
        }
View Full Code Here

    adjustBrowserWindowSize();
    return page;
  }

  private void adjustBrowserWindowSize() {
    getWebDriver().manage().window().setSize(new Dimension(1024, 768));
    System.out.println("Using browser " + browser + " with window size: " + getWebDriver().manage().window().getSize());
  }
View Full Code Here

    public void setPosition(Point targetPosition) {
    }

    @Override
    public Dimension getSize() {
        return new Dimension(0,0);
    }
View Full Code Here

import org.openqa.selenium.Dimension;

public class MainMenu extends PageObject {

    public void selectMenuOption(String menuOption) {
        getDriver().manage().window().setSize(new Dimension(1440,900));
        find(By.partialLinkText(menuOption)).click();
        waitFor(100).milliseconds();
    }
View Full Code Here

        d.get("http://www.google.com");
        assertTrue(d.manage().window().getSize().width > 100);
        assertTrue(d.manage().window().getSize().height > 100);

        d.manage().window().setSize(new Dimension(1024, 768));
        assertEquals(d.manage().window().getSize().width, 1024);
        assertEquals(d.manage().window().getSize().height, 768);
    }
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.