diff --git a/src/org/labkey/test/WebDriverWrapper.java b/src/org/labkey/test/WebDriverWrapper.java index 7a1147fce7..e894e92d18 100644 --- a/src/org/labkey/test/WebDriverWrapper.java +++ b/src/org/labkey/test/WebDriverWrapper.java @@ -3530,9 +3530,7 @@ public void actionPaste(WebElement input, String text) { Keys cmdKey = WebDriverUtils.MODIFIER_KEY; - Clipboard c = Toolkit.getDefaultToolkit().getSystemClipboard(); - StringSelection sel = new StringSelection(text); - c.setContents(sel, sel); + setClipboardContent(text); if (input == null) { @@ -3553,6 +3551,18 @@ public void actionPaste(WebElement input, String text) } } + public void clearClipboardContent() + { + setClipboardContent(" "); + } + + protected void setClipboardContent(String text) + { + Clipboard c = Toolkit.getDefaultToolkit().getSystemClipboard(); + StringSelection sel = new StringSelection(text); + c.setContents(sel, sel); + } + public String getClipboardContent() throws IOException, UnsupportedFlavorException { Transferable t = Toolkit.getDefaultToolkit().getSystemClipboard().getContents(null);