Class Widget

    • Constructor Detail

      • Widget

        public Widget​(org.openqa.selenium.WebElement wrappedElement)
    • Method Detail

      • findElements

        public List<org.openqa.selenium.WebElement> findElements​(org.openqa.selenium.By by)
        Specified by:
        findElements in interface org.openqa.selenium.SearchContext
      • findElement

        public org.openqa.selenium.WebElement findElement​(org.openqa.selenium.By by)
        Specified by:
        findElement in interface org.openqa.selenium.SearchContext
      • getWrappedElement

        public org.openqa.selenium.WebElement getWrappedElement()
        Specified by:
        getWrappedElement in interface org.openqa.selenium.WrapsElement
      • getDriver

        protected org.openqa.selenium.WebDriver getDriver()
        Returns wrapped WebDriver
        Returns:
        wrapped WebDriver
      • js

        protected org.openqa.selenium.JavascriptExecutor js()
        Returns wrapped js executor
        Returns:
        wrapped js executor
      • getLocation

        public org.openqa.selenium.Point getLocation()
        Description copied from interface: HasLocation
        Where on the page is the top left-hand corner of the rendered element?
        Specified by:
        getLocation in interface HasLocation
        Returns:
        A point, containing the location of the top left-hand corner of the element
      • getSize

        public org.openqa.selenium.Dimension getSize()
        Description copied from interface: HasSize
        It is the width and height of the rendered element
        Specified by:
        getSize in interface HasSize
        Returns:
        The size of the element on the page.
      • getRect

        public org.openqa.selenium.Rectangle getRect()
        Specified by:
        getRect in interface HasRectangle
        Returns:
        The location and size of the rendered element
      • getAttribute

        public String getAttribute​(String attribute)
        Description copied from interface: HasAttribute
        Taken from documentation of Selenium

        Get the value of the given attribute of the element. Will return the current value, even if this has been modified after the page has been loaded.

        More exactly, this method will return the value of the property with the given name, if it exists. If it does not, then the value of the attribute with the given name is returned. If neither exists, null is returned.

        The "style" attribute is converted as best can be to a text representation with a trailing semi-colon.

        The following are deemed to be "boolean" attributes, and will return either "true" or null:

        async, autofocus, autoplay, checked, compact, complete, controls, declare, defaultchecked, defaultselected, defer, disabled, draggable, ended, formnovalidate, hidden, indeterminate, iscontenteditable, ismap, itemscope, loop, multiple, muted, nohref, noresize, noshade, novalidate, nowrap, open, paused, pubdate, readonly, required, reversed, scoped, seamless, seeking, selected, truespeed, willvalidate

        Finally, the following commonly mis-capitalized attribute/property names are evaluated as expected:

        • If the given name is "class", the "className" property is returned.
        • If the given name is "readonly", the "readOnly" property is returned.
        Note: The reason for this behavior is that users frequently confuse attributes and properties. If you need to do something more precise, e.g., refer to an attribute even when a property of the same name exists, then you should evaluate Javascript to obtain the result you desire.
        Specified by:
        getAttribute in interface HasAttribute
        Parameters:
        attribute - The name of the attribute.
        Returns:
        The attribute/property's current value or null if the value is not set.
      • getCssValue

        public String getCssValue​(String propertyName)
        Description copied from interface: HasCssValue
        Taken from documentation of Selenium:

        Get the value of a given CSS property. Color values should be returned as rgba strings, so, for example if the "background-color" property is set as "green" in the HTML source, the returned value will be "rgba(0, 255, 0, 1)". Note that shorthand CSS properties (e.g. background, font, border, border-top, margin, margin-top, padding, padding-top, list-style, outline, pause, cue) are not returned, in accordance with the DOM CSS2 specification - you should directly access the longhand properties (e.g. background-color) to access the desired values.

        Specified by:
        getCssValue in interface HasCssValue
        Parameters:
        propertyName - the css property name of the element
        Returns:
        The current, computed value of the property.
      • isVisible

        public boolean isVisible()
        Specified by:
        isVisible in interface IsVisible
        Returns:
        Whether or not the element is visible on the page currently.
      • isEnabled

        public boolean isEnabled()
        Specified by:
        isEnabled in interface IsEnabled
        Returns:
        True if the element is enabled currently, false otherwise.
      • selfReference

        public Widget selfReference()