Interface SelenideElementWrapper<T>

Type Parameters:
T - wrapper component type
All Known Implementing Classes:
AbstractCheckbox, AbstractComboBox, AbstractComponent, AbstractDetails, AbstractDropdownComponent, AbstractField, AbstractMenu, AbstractMultiSelectComboBox, AbstractOverlay, AbstractOverlayComponent, AbstractSpecificConditionHandler, AbstractTextInput, Accordion, Accordion.Panel, Button, Checkbox, CheckboxGroup, CodeEditor, ComboBox, ComboBoxOverlay, ComboButton, Composite, DataGrid, DataGrid.AbstractCell, DataGrid.AbstractRow, DataGrid.Cell, DataGrid.HeaderCell, DataGrid.HeaderRow, DataGrid.Row, DatePicker, DateTimePicker, Details, DialogWindow, DropdownButton, EntityComboBox, EntityPicker, HorizontalMenu, ListMenu, MenuBarOverlay, MultiSelectComboBox, MultiSelectComboBoxPicker, MultiValuePicker, Notification, PasswordField, RadioButtonGroup, Select, SelectOverlay, TabSheet, TabSheet.Tab, TextArea, TextField, TimePicker, Unknown, ValuePicker, View

public interface SelenideElementWrapper<T>
Wrapper component for the SelenideElement. By default, delegates execution of standard element check methods to the wrapped SelenideElement.
  • Method Summary

    Modifier and Type
    Method
    Description
    default T
    Checks if element is disabled on the current page.
    default T
    Checks if element is visible on the current page.
    default T
    Checks if element is not disabled on the current page.
    default T
    Checks if element exist true on the current page.
    com.codeborne.selenide.SelenideElement
     
    default T
    should(com.codeborne.selenide.WebElementCondition... condition)
    Sequentially checks that given element meets all given conditions.
    default T
    should(com.codeborne.selenide.WebElementCondition condition, Duration timeout)
    Wait until given element meets given condition (with given timeout).
    default T
    shouldBe(com.codeborne.selenide.WebElementCondition... condition)
    default T
    shouldBe(com.codeborne.selenide.WebElementCondition condition, Duration timeout)
    Wait until given element meets given condition (with given timeout).
    default T
    shouldHave(com.codeborne.selenide.WebElementCondition... condition)
    default T
    shouldHave(com.codeborne.selenide.WebElementCondition condition, Duration timeout)
    Wait until given element meets given condition (with given timeout).
    default T
    Checks whether the given element has an attribute with given name.
    default T
    shouldHaveAttributeValue(String name, String expectedAttributeValue)
    Checks whether the given element has an attribute with given name and value.
    default T
    Checks that element has the given CSS class.
    default T
    shouldHaveCssValue(String cssAttribute, String expectedCssValue)
    Checks that element has the given CSS attribute with the given value.
    default T
    shouldNot(com.codeborne.selenide.WebElementCondition... condition)
    Sequentially checks that given element doesn't meet given conditions.
    default T
    shouldNot(com.codeborne.selenide.WebElementCondition condition, Duration timeout)
    Wait until given element doesn't meet given condition (with given timeout).
    default T
    shouldNotBe(com.codeborne.selenide.WebElementCondition... condition)
    default T
    shouldNotBe(com.codeborne.selenide.WebElementCondition condition, Duration timeout)
    Wait until given element doesn't meet given condition (with given timeout).
    default T
    shouldNotHave(com.codeborne.selenide.WebElementCondition... condition)
    default T
    shouldNotHave(com.codeborne.selenide.WebElementCondition condition, Duration timeout)
    Wait until given element doesn't meet given condition (with given timeout).
    default T
    Checks whether the given element hasn't an attribute with given name.
    default T
    shouldNotHaveAttributeValue(String name, String expectedAttributeValue)
    Checks whether the given element hasn't an attribute with given name and value.
    default T
    Checks that element hasn't the given CSS class.
    default T
    shouldNotHaveCssValue(String cssAttribute, String expectedCssValue)
    Checks that element hasn't the given CSS attribute with the given value.
  • Method Details

    • getDelegate

      com.codeborne.selenide.SelenideElement getDelegate()
      Returns:
      original wrapped SelenideElement
    • exists

      default T exists()
      Checks if element exist true on the current page. Throws an exception if element is not found, browser is closed or any WebDriver exception happened.
      Returns:
      this to call fluent API
    • displayed

      default T displayed()
      Checks if element is visible on the current page. Throws an exception if element is invisible, browser is closed or any WebDriver exception happened.
      Returns:
      this to call fluent API
    • disabled

      default T disabled()
      Checks if element is disabled on the current page. Throws an exception if element is not disabled, browser is closed or any WebDriver exception happened.
      Returns:
      this to call fluent API
    • enabled

      default T enabled()
      Checks if element is not disabled on the current page. Throws an exception if element is disabled, browser is closed or any WebDriver exception happened.
      Returns:
      this to call fluent API
    • should

      default T should(com.codeborne.selenide.WebElementCondition... condition)
      Sequentially checks that given element meets all given conditions.

      NOTE: If element doesn't match then conditions immediately, waits up to 4 seconds until element meets the conditions. It's extremely useful for dynamic content.

      Parameters:
      condition - conditions for checks
      Returns:
      this to call fluent API
      See Also:
    • should

      default T should(com.codeborne.selenide.WebElementCondition condition, Duration timeout)
      Wait until given element meets given condition (with given timeout).
      Parameters:
      condition - conditions for checks
      timeout - timeout for checks
      Returns:
      this to call fluent API
      See Also:
    • shouldHave

      default T shouldHave(com.codeborne.selenide.WebElementCondition... condition)
      Same as should(WebElementCondition...). Should be used for better readability.
      Parameters:
      condition - conditions for checks
      Returns:
      this to call fluent API
    • shouldHave

      default T shouldHave(com.codeborne.selenide.WebElementCondition condition, Duration timeout)
      Wait until given element meets given condition (with given timeout).
      Parameters:
      condition - conditions for checks
      timeout - timeout for checks
      Returns:
      this to call fluent API
      See Also:
    • shouldBe

      default T shouldBe(com.codeborne.selenide.WebElementCondition... condition)
      Same as should(WebElementCondition...). Should be used for better readability.
      Parameters:
      condition - conditions for checks
      Returns:
      this to call fluent API
    • shouldBe

      default T shouldBe(com.codeborne.selenide.WebElementCondition condition, Duration timeout)
      Wait until given element meets given condition (with given timeout).
      Parameters:
      condition - conditions for checks
      timeout - timeout for checks
      Returns:
      this to call fluent API
      See Also:
    • shouldNot

      default T shouldNot(com.codeborne.selenide.WebElementCondition... condition)
      Sequentially checks that given element doesn't meet given conditions.

      NOTE: If element doesn't match then conditions immediately, waits up to 4 seconds until element meets the conditions. It's extremely useful for dynamic content.

      Parameters:
      condition - conditions for checks
      Returns:
      this to call fluent API
      See Also:
    • shouldNot

      default T shouldNot(com.codeborne.selenide.WebElementCondition condition, Duration timeout)
      Wait until given element doesn't meet given condition (with given timeout).
      Parameters:
      condition - conditions for checks
      timeout - timeout for checks
      Returns:
      this to call fluent API
      See Also:
    • shouldNotHave

      default T shouldNotHave(com.codeborne.selenide.WebElementCondition... condition)
      Same as shouldNot(WebElementCondition...). Should be used for better readability.
      Parameters:
      condition - conditions for checks
      Returns:
      this to call fluent API
    • shouldNotHave

      default T shouldNotHave(com.codeborne.selenide.WebElementCondition condition, Duration timeout)
      Wait until given element doesn't meet given condition (with given timeout).
      Parameters:
      condition - conditions for checks
      timeout - timeout for checks
      Returns:
      this to call fluent API
      See Also:
    • shouldNotBe

      default T shouldNotBe(com.codeborne.selenide.WebElementCondition... condition)
      Same as shouldNot(WebElementCondition...). Should be used for better readability.
      Parameters:
      condition - conditions for checks
      Returns:
      this to call fluent API
    • shouldNotBe

      default T shouldNotBe(com.codeborne.selenide.WebElementCondition condition, Duration timeout)
      Wait until given element doesn't meet given condition (with given timeout).
      Parameters:
      condition - conditions for checks
      timeout - timeout for checks
      Returns:
      this to call fluent API
      See Also:
    • shouldHaveAttribute

      default T shouldHaveAttribute(String name)
      Checks whether the given element has an attribute with given name.
      Parameters:
      name - name of the attribute to check
      Returns:
      this to call fluent API
    • shouldNotHaveAttribute

      default T shouldNotHaveAttribute(String name)
      Checks whether the given element hasn't an attribute with given name.
      Parameters:
      name - name of the attribute to check
      Returns:
      this to call fluent API
    • shouldHaveAttributeValue

      default T shouldHaveAttributeValue(String name, String expectedAttributeValue)
      Checks whether the given element has an attribute with given name and value.
      Parameters:
      name - name of the attribute to check
      expectedAttributeValue - value of the attribute to check
      Returns:
      this to call fluent API
    • shouldNotHaveAttributeValue

      default T shouldNotHaveAttributeValue(String name, String expectedAttributeValue)
      Checks whether the given element hasn't an attribute with given name and value.
      Parameters:
      name - name of the attribute to check
      expectedAttributeValue - value of the attribute to check
      Returns:
      this to call fluent API
    • shouldHaveCss

      default T shouldHaveCss(String cssClass)
      Checks that element has the given CSS class.
      Parameters:
      cssClass - CSS class name to check
      Returns:
      this to call fluent API
    • shouldNotHaveCss

      default T shouldNotHaveCss(String cssClass)
      Checks that element hasn't the given CSS class.
      Parameters:
      cssClass - CSS class name to check
      Returns:
      this to call fluent API
    • shouldHaveCssValue

      default T shouldHaveCssValue(String cssAttribute, String expectedCssValue)
      Checks that element has the given CSS attribute with the given value.
      Parameters:
      cssAttribute - CSS attribute name to check
      expectedCssValue - expected value of the CSS attribute
      Returns:
      this to call fluent API
    • shouldNotHaveCssValue

      default T shouldNotHaveCssValue(String cssAttribute, String expectedCssValue)
      Checks that element hasn't the given CSS attribute with the given value.
      Parameters:
      cssAttribute - CSS attribute name to check
      expectedCssValue - expected value of the CSS attribute
      Returns:
      this to call fluent API