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 void
Clicks the clear button if it is visible.default boolean
Checks if the current element has a clear button.Methods inherited from interface com.vaadin.testbench.HasCallFunction
callFunction
Methods inherited from interface com.vaadin.testbench.HasElementQuery
$, $
Methods inherited from interface com.vaadin.testbench.HasSearchContext
getContext
Methods inherited from interface org.openqa.selenium.TakesScreenshot
getScreenshotAs
Methods 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:
true
if the element has a clear button,false
otherwise.
-
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
IllegalStateException
is thrown.- Throws:
IllegalStateException
- if the clear button is not visible
-