Class Actions.ClipboardAction
java.lang.Object
com.shaft.gui.element.internal.Actions.ClipboardAction
- Enclosing class:
Actions
Provides keyboard-shortcut-based clipboard operations for a target element.
Each method selects all text in the element first (Ctrl+A) before performing the
requested clipboard operation, then moves focus away (Arrow Right). Obtain an instance
via Actions.clipboard():
driver.element().clipboard().copyAll(By.id("sourceField"))
.and().clipboard().paste(By.id("destinationField"));
-
Method Summary
Modifier and TypeMethodDescriptioncopyAll(@NonNull org.openqa.selenium.By locator) Selects all text inside the located element and copies it to the system clipboard (Ctrl+A, Ctrl+C).cutAll(@NonNull org.openqa.selenium.By locator) Selects all text inside the located element, cuts it to the system clipboard (Ctrl+A, Ctrl+X), and leaves the field empty.deleteAll(@NonNull org.openqa.selenium.By locator) Selects all text inside the located element and deletes it (Ctrl+A, Backspace).paste(@NonNull org.openqa.selenium.By locator) Pastes the current system clipboard contents into the located element (Ctrl+V).
-
Method Details
-
deleteAll
Selects all text inside the located element and deletes it (Ctrl+A, Backspace).driver.element().clipboard().deleteAll(By.id("notes"));- Parameters:
locator- the locator for the target element whose text should be deleted- Returns:
- the parent
Actionsinstance for fluent chaining
-
copyAll
@Step("Copy text to clipboard") public Actions copyAll(@NonNull @NonNull org.openqa.selenium.By locator) Selects all text inside the located element and copies it to the system clipboard (Ctrl+A, Ctrl+C).driver.element().clipboard().copyAll(By.id("output"));- Parameters:
locator- the locator for the target element whose text should be copied- Returns:
- the parent
Actionsinstance for fluent chaining
-
cutAll
@Step("Cut text to clipboard") public Actions cutAll(@NonNull @NonNull org.openqa.selenium.By locator) Selects all text inside the located element, cuts it to the system clipboard (Ctrl+A, Ctrl+X), and leaves the field empty.- Parameters:
locator- the locator for the target element whose text should be cut- Returns:
- the parent
Actionsinstance for fluent chaining
-
paste
@Step("Paste from clipboard") public Actions paste(@NonNull @NonNull org.openqa.selenium.By locator) Pastes the current system clipboard contents into the located element (Ctrl+V).driver.element().clipboard().copyAll(By.id("source")) .and().clipboard().paste(By.id("destination"));- Parameters:
locator- the locator for the target element that should receive the paste- Returns:
- the parent
Actionsinstance for fluent chaining
-