Package com.vaadin.testbench
Interface HasClearButton
- All Superinterfaces:
HasCallFunction,HasElementQuery,HasSearchContext,org.openqa.selenium.SearchContext,org.openqa.selenium.TakesScreenshot,org.openqa.selenium.WebElement
- All Known Implementing Classes:
BigDecimalFieldElement,ComboBoxElement,DatePickerElement,EmailFieldElement,IntegerFieldElement,MultiSelectComboBoxElement,NumberFieldElement,PasswordFieldElement,TextAreaElement,TextFieldElement,TimePickerElement
The
HasClearButton interface provides methods to interact with an
element that may have a clear button. It includes functionality to check the
visibility of the clear button and to click it if it is visible.-
Method Summary
Modifier and TypeMethodDescriptiondefault voidClicks the clear button if it is visible.default booleanChecks if the current element has a clear button.Methods inherited from interface com.vaadin.testbench.HasCallFunction
callFunctionMethods inherited from interface com.vaadin.testbench.HasElementQuery
$, $Methods inherited from interface com.vaadin.testbench.HasSearchContext
getContextMethods inherited from interface org.openqa.selenium.TakesScreenshot
getScreenshotAsMethods inherited from interface org.openqa.selenium.WebElement
clear, click, findElement, findElements, getAccessibleName, getAriaRole, getAttribute, getCssValue, getDomAttribute, getDomProperty, getLocation, getRect, getShadowRoot, getSize, getTagName, getText, isDisplayed, isEnabled, isSelected, sendKeys, submit
-
Method Details
-
isClearButtonVisible
default boolean isClearButtonVisible()Checks if the current element has a clear button.- Returns:
trueif the element has a clear button,falseotherwise.
-
clickClearButton
default void clickClearButton()Clicks the clear button if it is visible.This method checks if the clear button is visible before attempting to click it. If the clear button is not visible, an
IllegalStateExceptionis thrown.- Throws:
IllegalStateException- if the clear button is not visible
-