Example usage for org.openqa.selenium Keys SHIFT

List of usage examples for org.openqa.selenium Keys SHIFT

Introduction

In this page you can find the example usage for org.openqa.selenium Keys SHIFT.

Prototype

Keys SHIFT

To view the source code for org.openqa.selenium Keys SHIFT.

Click Source Link

Usage

From source file:org.xwiki.test.wysiwyg.framework.AbstractWysiwygTestCase.java

License:Open Source License

public void typeShiftTab() {
    getRichTextArea().sendKeys(Keys.chord(Keys.SHIFT, Keys.TAB));
}

From source file:org.xwiki.test.wysiwyg.framework.AbstractWysiwygTestCase.java

License:Open Source License

/**
 * Triggers the wysiwyg toolbar update by typing a key. To be used after programatically setting the selection (with
 * {@link AbstractWysiwygTestCase#select(String, int, String, int)} or
 * {@link AbstractWysiwygTestCase#moveCaret(String, int)}): it will not influence the selection but it will cause
 * the toolbar to update according to the new selection.
 *///www .j  ava 2 s  .c om
protected void triggerToolbarUpdate() {
    getRichTextArea().sendKeys(Keys.SHIFT);
}

From source file:org.xwiki.test.wysiwyg.MacroTest.java

License:Open Source License

/**
 * Collapses the currently selected macro or, if none is selected, all the macros using the shortcut key.
 *///from www  .  j av  a2s .com
public void collapseMacrosUsingShortcutKey() {
    getRichTextArea().sendKeys(Keys.chord(Keys.CONTROL, Keys.SHIFT, "c"));
}

From source file:org.xwiki.test.wysiwyg.MacroTest.java

License:Open Source License

/**
 * Expands the currently selected macro or, if none is selected, all the macros using the shortcut key.
 *//*w ww  .  ja v  a2  s . c om*/
public void expandMacrosUsingShortcutKey() {
    getRichTextArea().sendKeys(Keys.chord(Keys.CONTROL, Keys.SHIFT, "e"));
}

From source file:org.xwiki.test.wysiwyg.MacroTest.java

License:Open Source License

/**
 * Refreshes the macros present in the edited document using the shortcut key.
 *//*from w  w w  .  j  a  v  a 2  s .c o  m*/
public void refreshMacrosUsingShortcutKey() {
    getRichTextArea().sendKeys(Keys.chord(Keys.CONTROL, Keys.SHIFT, "r"));
    waitForEditorToLoad();
}

From source file:org.xwiki.test.wysiwyg.SubmitTest.java

License:Open Source License

/**
 * Press Alt+shift+s to save and continue.
 *///w  ww.  j  a v  a  2  s.c  o m
private void typeShortcutsForSaveAndContinue() {
    getSourceTextArea().sendKeys(Keys.chord(Keys.ALT, Keys.SHIFT, "s"));
    waitForNotificationSuccessMessage("Saved");
}

From source file:org.xwiki.wysiwyg.test.ui.EditWYSIWYGTest.java

License:Open Source License

/**
 * Test if an undo step reverts only one paste operation from a sequence, and not all of them.
 *//*from w w  w.j ava2s . co  m*/
@Test
@IgnoreBrowsers({
        @IgnoreBrowser(value = "internet.*", version = "8\\.*", reason = "See http://jira.xwiki.org/browse/XE-1146"),
        @IgnoreBrowser(value = "internet.*", version = "9\\.*", reason = "See http://jira.xwiki.org/browse/XE-1177") })
public void testUndoRepeatedPaste() {
    EditorElement editor = this.editPage.getContentEditor();
    RichTextAreaElement textArea = editor.getRichTextArea();
    // Type text, select it (Shift+LeftArrow) and copy it (Control+C).
    // NOTE: We don't use Control+A to select the text because it selects also the BR element.
    textArea.sendKeys("q", Keys.chord(Keys.SHIFT, Keys.ARROW_LEFT), Keys.chord(Keys.CONTROL, "c"));
    // Then paste it 4 times (Control+V).
    for (int i = 0; i < 4; i++) {
        // Release the key after each paste so that the history records an entry for each paste. In case the paste
        // content is cleaned automatically, the editor cleans consecutive paste events (that happen one after
        // another) together and so a single history entry is recorded for such a group of paste events.
        textArea.sendKeys(Keys.chord(Keys.CONTROL, "v"));
    }
    // Undo the last paste.
    editor.getToolBar().clickUndoButton();
    Assert.assertEquals("qqq", textArea.getText());
}

From source file:Student1732MD.SeleniumClass.java

public SeleniumClass() throws InterruptedException {
    driver.get("http://facebook.com/");
    driver.manage().window().maximize();

    WebElement txtUserName = driver.findElement(By.id("email"));
    driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
    Thread.sleep(1000);//from   w w  w .ja  va 2 s . co m
    Action seriesOfActions = action.moveToElement(txtUserName).click().keyDown(txtUserName, Keys.SHIFT)
            .sendKeys(txtUserName, "hello").keyUp(txtUserName, Keys.SHIFT).doubleClick(txtUserName)
            .contextClick().build();

    seriesOfActions.perform();

}