Class ClearWithShortcut
java.lang.Object
com.codeborne.selenide.commands.Clear
com.codeborne.selenide.clearwithshortcut.ClearWithShortcut
- All Implemented Interfaces:
Command<SelenideElement>
Clean the input field value.
The standard Selenium method WebElement.clear()
does not help in case of
"tricky" inputs generated by Vue.js, React and other fancy frameworks.
That's why we need to clear the field value by emulating real user actions:
- Select the whole text
- press "Delete"
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Clear the input content without triggering "change" and "blur" eventsprotected void
clearWithShortcut
(Driver driver, org.openqa.selenium.WebElement input) execute
(SelenideElement proxy, WebElementSource locator, Object[] args) protected com.codeborne.selenide.clearwithshortcut.Platform
getPlatform
(Driver driver) Methods inherited from class com.codeborne.selenide.commands.Clear
blurSafely, clearAndTrigger
-
Constructor Details
-
ClearWithShortcut
public ClearWithShortcut()
-
-
Method Details
-
execute
@Nonnull @CheckReturnValue public SelenideElement execute(SelenideElement proxy, WebElementSource locator, @Nullable Object[] args) - Specified by:
execute
in interfaceCommand<SelenideElement>
- Overrides:
execute
in classClear
-
clear
Clear the input content without triggering "change" and "blur" events -
clearWithShortcut
-
getPlatform
@Nonnull @CheckReturnValue protected com.codeborne.selenide.clearwithshortcut.Platform getPlatform(Driver driver)
-