Class RealHtmlElementState

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void focus()
      Moves the focus to the specified element.
      void highlightElement()
      Tries to briefly change the element's background color to yellow.
      boolean isElementDisplayed()
      Check whether the element is displayed or not
      boolean isElementEnabled()  
      boolean isElementPresent()  
      void verifyExist()
      Verifies the element exist throws an exception if verification fail
      void verifyNotExist()
      Verifies the element does NOT exist throws an exception if verification fail
      void waitToBecomeDisabled()
      Waits for a period of time (check the 'elementStateChangeDelay' property) the element to become disabled throws an exception if it does not become disabled for the default waiting period (check the 'elementStateChangeDelay' property)
      void waitToBecomeDisabled​(int millis)
      Waits for a period of time the element to become disabled throws an exception if it does not become disabled for the specified period
      void waitToBecomeDisplayed()
      Waits for a period of time (check the 'elementStateChangeDelay' property) the element to become displayed throws an exception if it does not become displayed for the default waiting period (check the 'elementStateChangeDelay' property)
      void waitToBecomeDisplayed​(int millis)
      Waits for a period of time the element to become displayed throws an exception if it does not become displayed for the specified period
      void waitToBecomeEnabled()
      Waits for a period of time (check the 'elementStateChangeDelay' property) the element to become enabled throws an exception if it does not become enabled for the default waiting period (check the 'elementStateChangeDelay' property)
      void waitToBecomeEnabled​(int millis)
      Waits for a period of time the element to become enabled throws an exception if it does not become enabled for the specified period
      void waitToBecomeExisting()
      Waits for a period of time (check the 'elementStateChangeDelay' property) the element to become existing throws an exception if it does not become existing for the default waiting period (check the 'elementStateChangeDelay' property)
      void waitToBecomeExisting​(int millis)
      Waits for a period of time the element to become existing throws an exception if it does not become existing for the specified period
      void waitToBecomeHidden()
      Waits for a period of time (check the 'elementStateChangeDelay' property) the element to become hidden throws an exception if it does not become hidden for the default waiting period (check the 'elementStateChangeDelay' property)
      void waitToBecomeHidden​(int millis)
      Waits for a period of time the element to become hidden throws an exception if it does not become hidden for the specified period
      void waitToBecomeNotExisting()
      Waits for a period of time (check the 'elementStateChangeDelay' property) the element to became non-existing throws an exception if it does not become non-existing for the default waiting period (check the 'elementStateChangeDelay' property)
      void waitToBecomeNotExisting​(int millis)
      Waits for a period of time the element to became non-existing throws an exception if it does not become non-existing for the specified period
    • Constructor Detail

      • RealHtmlElementState

        public RealHtmlElementState​(UiElement uiElement)
        Parameters:
        uiElement - the element of interest
    • Method Detail

      • focus

        public void focus()
        Moves the focus to the specified element. Note: This is somewhat breakable as the browser window needs to be the active system window, otherwise the keyboard events will go to another application.
        Specified by:
        focus in interface IHtmlElementState
      • verifyExist

        public void verifyExist()
        Verifies the element exist throws an exception if verification fail
        Specified by:
        verifyExist in interface IHtmlElementState
      • verifyNotExist

        public void verifyNotExist()
        Verifies the element does NOT exist throws an exception if verification fail
        Specified by:
        verifyNotExist in interface IHtmlElementState
      • waitToBecomeExisting

        public void waitToBecomeExisting()
        Waits for a period of time (check the 'elementStateChangeDelay' property) the element to become existing throws an exception if it does not become existing for the default waiting period (check the 'elementStateChangeDelay' property)
        Specified by:
        waitToBecomeExisting in interface IHtmlElementState
      • waitToBecomeExisting

        public void waitToBecomeExisting​(int millis)
        Waits for a period of time the element to become existing throws an exception if it does not become existing for the specified period
        Specified by:
        waitToBecomeExisting in interface IHtmlElementState
      • waitToBecomeNotExisting

        public void waitToBecomeNotExisting()
        Waits for a period of time (check the 'elementStateChangeDelay' property) the element to became non-existing throws an exception if it does not become non-existing for the default waiting period (check the 'elementStateChangeDelay' property)
        Specified by:
        waitToBecomeNotExisting in interface IHtmlElementState
      • waitToBecomeNotExisting

        public void waitToBecomeNotExisting​(int millis)
        Waits for a period of time the element to became non-existing throws an exception if it does not become non-existing for the specified period
        Specified by:
        waitToBecomeNotExisting in interface IHtmlElementState
      • waitToBecomeDisplayed

        public void waitToBecomeDisplayed()
        Waits for a period of time (check the 'elementStateChangeDelay' property) the element to become displayed throws an exception if it does not become displayed for the default waiting period (check the 'elementStateChangeDelay' property)
        Specified by:
        waitToBecomeDisplayed in interface IHtmlElementState
      • waitToBecomeDisplayed

        public void waitToBecomeDisplayed​(int millis)
        Waits for a period of time the element to become displayed throws an exception if it does not become displayed for the specified period
        Specified by:
        waitToBecomeDisplayed in interface IHtmlElementState
      • waitToBecomeHidden

        public void waitToBecomeHidden()
        Waits for a period of time (check the 'elementStateChangeDelay' property) the element to become hidden throws an exception if it does not become hidden for the default waiting period (check the 'elementStateChangeDelay' property)
        Specified by:
        waitToBecomeHidden in interface IHtmlElementState
      • waitToBecomeHidden

        public void waitToBecomeHidden​(int millis)
        Waits for a period of time the element to become hidden throws an exception if it does not become hidden for the specified period
        Specified by:
        waitToBecomeHidden in interface IHtmlElementState
      • waitToBecomeEnabled

        public void waitToBecomeEnabled()
        Waits for a period of time (check the 'elementStateChangeDelay' property) the element to become enabled throws an exception if it does not become enabled for the default waiting period (check the 'elementStateChangeDelay' property)
        Specified by:
        waitToBecomeEnabled in interface IHtmlElementState
      • waitToBecomeEnabled

        public void waitToBecomeEnabled​(int millis)
        Waits for a period of time the element to become enabled throws an exception if it does not become enabled for the specified period
        Specified by:
        waitToBecomeEnabled in interface IHtmlElementState
      • waitToBecomeDisabled

        public void waitToBecomeDisabled()
        Waits for a period of time (check the 'elementStateChangeDelay' property) the element to become disabled throws an exception if it does not become disabled for the default waiting period (check the 'elementStateChangeDelay' property)
        Specified by:
        waitToBecomeDisabled in interface IHtmlElementState
      • waitToBecomeDisabled

        public void waitToBecomeDisabled​(int millis)
        Waits for a period of time the element to become disabled throws an exception if it does not become disabled for the specified period
        Specified by:
        waitToBecomeDisabled in interface IHtmlElementState
      • highlightElement

        public void highlightElement()
        Tries to briefly change the element's background color to yellow. Does not work on all elements. It is useful for debugging purposes.
        Specified by:
        highlightElement in interface IHtmlElementState
      • isElementDisplayed

        public boolean isElementDisplayed()
        Check whether the element is displayed or not
        Specified by:
        isElementDisplayed in interface IHtmlElementState
        Returns:
        true if the element is displayed