List of usage examples for org.openqa.selenium Keys SHIFT
Keys SHIFT
To view the source code for org.openqa.selenium Keys SHIFT.
Click Source Link
From source file:org.eclipse.che.selenium.miscellaneous.CheckCreatingProjectInEmptyWsTest.java
License:Open Source License
@Test public void checkImportAndCreatingFromProjectExplorer() throws InterruptedException { loader.waitOnClosed();//ww w . ja v a 2 s.c o m projectExplorer.clickOnCreateProjectLink(10); wizard.closeWithIcon(); projectExplorer.clickOnEmptyAreaOfProjectTree(1); projectExplorer.clickOnImportProjectLink(1); importProjectFromLocation.closeWithIcon(); projectExplorer.clickOnEmptyAreaOfProjectTree(1); try { actionsFactory.createAction(ide.driver()).sendKeys(Keys.ALT.toString() + "x").perform(); wizard.closeWithIcon(); } catch (org.openqa.selenium.TimeoutException e) { actionsFactory.createAction(ide.driver()).sendKeys(Keys.ALT.toString() + "x").perform(); wizard.closeWithIcon(); } projectExplorer.clickOnEmptyAreaOfProjectTree(1); try { actionsFactory.createAction(ide.driver()).sendKeys(Keys.ALT.toString() + Keys.SHIFT.toString() + "A") .perform(); importProjectFromLocation.closeWithIcon(); } catch (org.openqa.selenium.TimeoutException e) { actionsFactory.createAction(ide.driver()).sendKeys(Keys.ALT.toString() + Keys.SHIFT.toString() + "A") .perform(); importProjectFromLocation.closeWithIcon(); } }
From source file:org.eclipse.che.selenium.miscellaneous.CheckCreatingProjectInEmptyWsTest.java
License:Open Source License
@Test(priority = 1) public void checkImportAndCreatingFromEditorPanel() { WebDriverWait waitForWebElements = new WebDriverWait(ide.driver(), LOAD_PAGE_TIMEOUT_SEC); String locatorToEditorContaiPaineId = "//div[@id='gwt-debug-editorMultiPartStack-contentPanel']"; String locatorToImportProjectLnk = locatorToEditorContaiPaineId + "//div[text()='Import Project...']"; String locatorToCreateProjectLnk = locatorToEditorContaiPaineId + "//div[text()='Create Project...']"; loader.waitOnClosed();/*ww w .j av a 2s . c o m*/ waitForWebElements.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(locatorToImportProjectLnk))) .click(); importProjectFromLocation.closeWithIcon(); waitForWebElements.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(locatorToCreateProjectLnk))) .click(); wizard.closeWithIcon(); waitForWebElements .until(ExpectedConditions.visibilityOfElementLocated((By.xpath(locatorToEditorContaiPaineId)))) .click(); try { actionsFactory.createAction(ide.driver()).sendKeys(Keys.ALT.toString() + "x").perform(); wizard.closeWithIcon(); } catch (org.openqa.selenium.TimeoutException e) { actionsFactory.createAction(ide.driver()).sendKeys(Keys.ALT.toString() + "x").perform(); wizard.closeWithIcon(); } waitForWebElements.until( ExpectedConditions.visibilityOf(ide.driver().findElement(By.xpath(locatorToEditorContaiPaineId)))) .click(); try { actionsFactory.createAction(ide.driver()).sendKeys(Keys.ALT.toString() + Keys.SHIFT.toString() + "A") .perform(); importProjectFromLocation.closeWithIcon(); } catch (org.openqa.selenium.TimeoutException e) { actionsFactory.createAction(ide.driver()).sendKeys(Keys.ALT.toString() + Keys.SHIFT.toString() + "A") .perform(); importProjectFromLocation.closeWithIcon(); } }
From source file:org.eclipse.che.selenium.miscellaneous.TerminalTypingTest.java
License:Open Source License
@Test public void checkTerminalTypingWithShift() { loader.waitOnClosed();/*from w ww . j a va2s . c om*/ terminal.selectTerminalTab(); terminal.waitTerminalConsole(); terminal.waitTerminalIsNotEmpty(); for (Pair<String, String> pair : keyPairs) { terminal.typeIntoTerminal(Keys.SHIFT + pair.first()); terminal.waitExpectedTextIntoTerminal("/projects$ " + pair.second()); terminal.typeIntoTerminal(Keys.BACK_SPACE.toString()); } }
From source file:org.eclipse.che.selenium.pageobject.AskForValueDialog.java
License:Open Source License
/** launch the 'Rename project' form by keyboard */ public void launchFindFormByKeyboard() { actionsFactory.createAction(seleniumWebDriver).sendKeys(Keys.SHIFT, Keys.F6).perform(); }
From source file:org.eclipse.che.selenium.pageobject.FindText.java
License:Open Source License
/** launch the 'Find' main form by keyboard */ public void launchFindFormByKeyboard() { loader.waitOnClosed();/*from w w w. j a va 2 s .c o m*/ Actions action = actionsFactory.createAction(seleniumWebDriver); action.keyDown(Keys.CONTROL).keyDown(Keys.SHIFT).sendKeys("f").keyUp(Keys.SHIFT).keyUp(Keys.CONTROL) .perform(); }
From source file:org.eclipse.che.selenium.pageobject.intelligent.CommandsPalette.java
License:Open Source License
/** Start CommandPalette widget by Shift+F10 hot keys */ public void openCommandPaletteByHotKeys() { loader.waitOnClosed();/*from w ww .j a v a 2 s .c o m*/ actionsFactory.createAction(seleniumWebDriver).sendKeys(Keys.SHIFT.toString(), Keys.F10.toString()) .perform(); redrawUiElementTimeout.until(ExpectedConditions.visibilityOf(commandPalette)); }
From source file:org.eclipse.che.selenium.pageobject.ProjectExplorer.java
License:Open Source License
/** * Performs the multi-select by {@code Shift} key * * @param path item's path in format: "Test/src/pom.xml". *///ww w .j a v a 2 s . c om public void selectMultiFilesByShiftKey(String path) { Actions actions = actionsFactory.createAction(seleniumWebDriver); actions.keyDown(SHIFT).perform(); waitAndSelectItem(path); waitItemIsSelected(path); actions.keyUp(Keys.SHIFT).perform(); }
From source file:org.eclipse.scout.rt.testing.ui.rap.RapMock.java
License:Open Source License
@Override public void pressKey(Key key) { switch (key) { case Shift:/*from w w w.j a va2s . c o m*/ m_actionBuilder.keyDown(Keys.SHIFT); m_modifierPressed = true; break; case Control: m_actionBuilder.keyDown(Keys.CONTROL); // m_bot.controlKeyDown(); // m_bot.keyDownNative("17"); // m_keyList.add(Keys.CONTROL); m_modifierPressed = true; break; case Alt: m_actionBuilder.keyDown(Keys.ALT); m_modifierPressed = true; break; case Windows: m_actionBuilder.keyDown(Keys.META); m_modifierPressed = true; break; default: m_actionBuilder.sendKeys(toSeleniumKey(key).toString()); m_actionBuilder.perform(); // m_bot.keyDown(m_currentWidgetId, toSeleniumKey(key)); waitForIdle(); break; } }
From source file:org.eclipse.scout.rt.testing.ui.rap.RapMock.java
License:Open Source License
@Override public void releaseKey(Key key) { switch (key) { case Shift:/*w w w . jav a2s . com*/ m_actionBuilder.keyUp(Keys.SHIFT); m_modifierPressed = false; break; case Control: m_actionBuilder.keyUp(Keys.CONTROL); // m_bot.controlKeyUp(); // m_bot.keyUpNative("17"); // getCurrentElement().sendKeys(m_keyList.toArray(new CharSequence[m_keyList.size()])); // m_keyList.clear(); // getCurrentElement().sendKeys(Keys.CONTROL, "a"); m_modifierPressed = false; break; case Alt: m_actionBuilder.keyUp(Keys.ALT); m_modifierPressed = false; break; case Windows: m_actionBuilder.keyUp(Keys.META); m_modifierPressed = false; break; default: m_actionBuilder.keyUp(toSeleniumKey(key)); // m_bot.keyUp(m_currentWidgetId, toSeleniumKey(key)); break; } m_actionBuilder.perform(); waitForIdle(); }
From source file:org.eclipse.scout.rt.testing.ui.rap.RapMock.java
License:Open Source License
protected Keys toSeleniumKey(Key key) { switch (key) { case Shift:// w w w.j a v a 2s .c o m return Keys.SHIFT; case Control: return Keys.CONTROL; case Alt: return Keys.ALT; case Delete: return Keys.DELETE; case Backspace: return Keys.BACK_SPACE; case Enter: return Keys.ENTER; case Esc: return Keys.ESCAPE; case Tab: return Keys.TAB; case ContextMenu: throw new IllegalArgumentException("Unknown keyboard key: " + key); case Up: return Keys.UP; case Down: return Keys.DOWN; case Left: return Keys.LEFT; case Right: return Keys.RIGHT; case Windows: return Keys.META; case F1: return Keys.F1; case F2: return Keys.F2; case F3: return Keys.F3; case F4: return Keys.F4; case F5: return Keys.F5; case F6: return Keys.F6; case F7: return Keys.F7; case F8: return Keys.F8; case F9: return Keys.F9; case F10: return Keys.F10; case F11: return Keys.F11; case F12: return Keys.F12; case Home: return Keys.HOME; case End: return Keys.END; case PageUp: return Keys.PAGE_UP; case PageDown: return Keys.PAGE_DOWN; case NumPad0: return Keys.NUMPAD0; case NumPad1: return Keys.NUMPAD1; case NumPad2: return Keys.NUMPAD2; case NumPad3: return Keys.NUMPAD3; case NumPad4: return Keys.NUMPAD4; case NumPad5: return Keys.NUMPAD5; case NumPad6: return Keys.NUMPAD6; case NumPad7: return Keys.NUMPAD7; case NumPad8: return Keys.NUMPAD8; case NumPadMultiply: return Keys.MULTIPLY; case NumPadDivide: return Keys.DIVIDE; case NumPadAdd: return Keys.ADD; case NumPadSubtract: return Keys.SUBTRACT; case NumPadDecimal: return Keys.DECIMAL; case NumPadSeparator: return Keys.SEPARATOR; default: throw new IllegalArgumentException("Unknown keyboard key: " + key); } }