Class AbstractWebDriverCore

    • Field Summary

      • Fields inherited from interface eu.tsystems.mms.tic.testframework.logging.Loggable

        prompt
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()  
      void click()  
      void contextClick()  
      void deselect()  
      void doubleClick()
      doubleclick
      void findWebElement​(java.util.function.Consumer<org.openqa.selenium.WebElement> consumer)
      Finds the WebElement from a list of web elements according to it's selector index in GuiElementData.getIndex().
      java.lang.String getAttribute​(java.lang.String attributeName)
      WebElement.getAttribute.
      java.lang.String getCssValue​(java.lang.String cssIdentifier)
      WebElement.getCssValue.
      int getLengthOfValueAfterSendKeys​(java.lang.String textToInput)
      Types your text and returns the length of the attribute 'value' afterwards.
      org.openqa.selenium.Point getLocation()
      WebElement.getLocation.
      int getNumberOfFoundElements()
      A given location strategy (Locator + WebElementFilter) can match to many elements in a Website.
      org.openqa.selenium.Rectangle getRect()
      Gets the element's rectangle
      org.openqa.selenium.Dimension getSize()
      WebElement.getSize.
      java.lang.String getTagName()
      WebElement.getTagName.
      java.lang.String getText()
      Calls WebElement.getText.
      java.util.List<java.lang.String> getTextsFromChildren()
      Returns with all texts of child-elements.
      void highlight​(java.awt.Color color)  
      protected void highlightWebElement​(org.openqa.selenium.WebElement webElement, java.awt.Color color)  
      void hover()  
      boolean isDisplayed()
      WebElement.isDisplayed.
      boolean isEnabled()
      WebElement.isEnabled.
      boolean isPresent()
      Checks if an element is found by webdriver.
      boolean isSelectable()
      Checks if the element is selectable.
      boolean isSelected()
      WebElement.isSelected.
      boolean isVisible​(boolean fullyVisible)
      Checks if the element is visible in the current viewport
      void scrollIntoView​(org.openqa.selenium.Point offset)  
      void scrollToElement​(int yOffset)  
      void scrollToTop()  
      void select()  
      void sendKeys​(java.lang.CharSequence... charSequences)  
      void submit()  
      abstract void swipe​(int offsetX, int offSetY)
      Swipe the element by the given offset.
      protected abstract void switchToDefaultContent​(org.openqa.selenium.WebDriver webDriver)  
      protected abstract void switchToFrame​(org.openqa.selenium.WebDriver webDriver, org.openqa.selenium.WebElement webElement)  
      java.io.File takeScreenshot()
      Takes a screenshot of the GuiElement
      java.lang.String toString()
      Build a nice string.
      void type​(java.lang.String text)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface eu.tsystems.mms.tic.testframework.logging.Loggable

        log
    • Constructor Detail

      • AbstractWebDriverCore

        public AbstractWebDriverCore​(GuiElementData guiElementData)
    • Method Detail

      • switchToDefaultContent

        protected abstract void switchToDefaultContent​(org.openqa.selenium.WebDriver webDriver)
      • switchToFrame

        protected abstract void switchToFrame​(org.openqa.selenium.WebDriver webDriver,
                                              org.openqa.selenium.WebElement webElement)
      • getTagName

        public java.lang.String getTagName()
        Description copied from interface: GuiElementCore
        WebElement.getTagName.
        Specified by:
        getTagName in interface GuiElementCore
        Returns:
        The tag name as String.
      • getAttribute

        public java.lang.String getAttribute​(java.lang.String attributeName)
        Description copied from interface: GuiElementCore
        WebElement.getAttribute.
        Specified by:
        getAttribute in interface GuiElementCore
        Parameters:
        attributeName - Name of the attribute.
        Returns:
        The value of the attribute.
      • isSelected

        public boolean isSelected()
        Description copied from interface: GuiElementCore
        WebElement.isSelected.
        Specified by:
        isSelected in interface GuiElementCore
        Returns:
        true if element is selected.
      • isEnabled

        public boolean isEnabled()
        Description copied from interface: GuiElementCore
        WebElement.isEnabled.
        Specified by:
        isEnabled in interface GuiElementCore
        Returns:
        true if element is enabled.
      • getText

        public java.lang.String getText()
        Description copied from interface: GuiElementCore
        Calls WebElement.getText. Please note that this will only return a String, if the elements text is actually visible.
        Specified by:
        getText in interface GuiElementCore
        Returns:
        text of the element.
      • isDisplayed

        public boolean isDisplayed()
        Description copied from interface: GuiElementCore
        WebElement.isDisplayed.
        Specified by:
        isDisplayed in interface GuiElementCore
        Returns:
        true if element is displayed.
      • getRect

        public org.openqa.selenium.Rectangle getRect()
        Description copied from interface: GuiElementCore
        Gets the element's rectangle
        Specified by:
        getRect in interface GuiElementCore
      • isVisible

        public boolean isVisible​(boolean fullyVisible)
        Description copied from interface: GuiElementCore
        Checks if the element is visible in the current viewport
        Specified by:
        isVisible in interface GuiElementCore
        Returns:
      • isSelectable

        public boolean isSelectable()
        Description copied from interface: GuiElementCore
        Checks if the element is selectable.
        Specified by:
        isSelectable in interface GuiElementCore
        Returns:
        ture, if the element is selectable
      • getLocation

        public org.openqa.selenium.Point getLocation()
        Description copied from interface: GuiElementCore
        WebElement.getLocation.
        Specified by:
        getLocation in interface GuiElementCore
        Returns:
        The location of the webelement.
      • getSize

        public org.openqa.selenium.Dimension getSize()
        Description copied from interface: GuiElementCore
        WebElement.getSize.
        Specified by:
        getSize in interface GuiElementCore
        Returns:
        Size of the webelement.
      • getCssValue

        public java.lang.String getCssValue​(java.lang.String cssIdentifier)
        Description copied from interface: GuiElementCore
        WebElement.getCssValue.
        Specified by:
        getCssValue in interface GuiElementCore
        Parameters:
        cssIdentifier - .
        Returns:
        Css value of the webelement.
      • highlightWebElement

        protected void highlightWebElement​(org.openqa.selenium.WebElement webElement,
                                           java.awt.Color color)
      • isPresent

        public boolean isPresent()
        Description copied from interface: GuiElementCore
        Checks if an element is found by webdriver.
        Specified by:
        isPresent in interface GuiElementCore
        Returns:
        true if found, false otherwise.
      • getTextsFromChildren

        public java.util.List<java.lang.String> getTextsFromChildren()
        Description copied from interface: GuiElementCore
        Returns with all texts of child-elements.
        Specified by:
        getTextsFromChildren in interface GuiElementCore
        Returns:
        .
      • swipe

        public abstract void swipe​(int offsetX,
                                   int offSetY)
        Description copied from interface: GuiElementCoreActions
        Swipe the element by the given offset. (0,0) should be the top left.
        Specified by:
        swipe in interface GuiElementCoreActions
        Parameters:
        offsetX - horizontal offset in pixel.
        offSetY - vertical offset in pixel.
      • getLengthOfValueAfterSendKeys

        public int getLengthOfValueAfterSendKeys​(java.lang.String textToInput)
        Description copied from interface: GuiElementCore
        Types your text and returns the length of the attribute 'value' afterwards. Can be useful to check a maximal input length
        Specified by:
        getLengthOfValueAfterSendKeys in interface GuiElementCore
        Parameters:
        textToInput - text to check
        Returns:
        Length of the attribute 'value'
        See Also:
        *
      • getNumberOfFoundElements

        public int getNumberOfFoundElements()
        Description copied from interface: GuiElementCore
        A given location strategy (Locator + WebElementFilter) can match to many elements in a Website. This method returns that number. This can be useful for tests, that want to ensure that a GuiElement is found n times.
        Specified by:
        getNumberOfFoundElements in interface GuiElementCore
        Returns:
        The number, how many WebElements were identified by this GuiElement.
      • toString

        public java.lang.String toString()
        Build a nice string.
        Overrides:
        toString in class java.lang.Object
        Returns:
        .