Class WebPage

    • Field Detail

      • DEFAULT_TIMEOUT

        public static final int DEFAULT_TIMEOUT
        Can be used by tests as default timeouts. This way you can change these values to change all the timeout in the tests. DEFAULT_TIMEOUT is used for regular timeouts (loading an ajax page an ajax dialog etc.) while BIG_TIMEOUT should be used for pages that are slower (like the home of a GWT application)
        See Also:
        Constant Field Values
      • driver

        @Inject
        protected org.openqa.selenium.WebDriver driver
    • Constructor Detail

      • WebPage

        public WebPage()
    • Method Detail

      • ensureLoaded

        public WebPage ensureLoaded()
        Should be overridden by dynamic page (using ajax) to wait until the page is completely loaded By default nothing is done (page is assumed to be loaded)
        Returns:
        the page itself
      • getDriver

        public org.openqa.selenium.WebDriver getDriver()
      • home

        public void home()
      • to

        public void to​(String path)
      • hasElement

        public boolean hasElement​(org.openqa.selenium.By by)
      • hasElement

        public boolean hasElement​(org.openqa.selenium.By by,
                                  int timeoutInSeconds)
      • findElement

        public org.openqa.selenium.WebElement findElement​(org.openqa.selenium.By by)
      • findElements

        public List<org.openqa.selenium.WebElement> findElements​(org.openqa.selenium.By by)
      • findElement

        public org.openqa.selenium.WebElement findElement​(org.openqa.selenium.By by,
                                                          int timeOutInSeconds)
      • waitUntilElementFound

        public org.openqa.selenium.WebElement waitUntilElementFound​(org.openqa.selenium.By by,
                                                                    int timeOutInSeconds)
      • waitUntilElementNotFound

        public void waitUntilElementNotFound​(org.openqa.selenium.By by,
                                             int timeOutInSeconds)
      • getPage

        public <T extends WebPage> T getPage​(Class<T> type)
      • getAttachment

        public Attachment getAttachment()
        Gives access to an attachment retrieved from this web page.
      • flushPageCache

        public static void flushPageCache()