List of usage examples for org.openqa.selenium Keys ESCAPE
Keys ESCAPE
To view the source code for org.openqa.selenium Keys ESCAPE.
Click Source Link
From source file:org.eclipse.che.selenium.pageobject.RecentFiles.java
License:Open Source License
/** Close the 'Recent Files' window */ public void closeRecentFiles() { actionsFactory.createAction(seleniumWebDriver).sendKeys(Keys.ESCAPE).perform(); new WebDriverWait(seleniumWebDriver, LOAD_PAGE_TIMEOUT_SEC) .until(ExpectedConditions.invisibilityOfElementLocated(By.xpath(Locators.RECENT_FILES))); }
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:// www . j av a 2s.co 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); } }
From source file:org.jspringbot.keyword.selenium.SeleniumHelper.java
License:Open Source License
private String mapAsciiKeyCodeToKey(int keyCode) { Map<Integer, Keys> keysMap = new HashMap<Integer, Keys>(); keysMap.put(0, Keys.NULL);/*w ww . ja v a 2s. c o m*/ keysMap.put(8, Keys.BACK_SPACE); keysMap.put(9, Keys.TAB); keysMap.put(10, Keys.RETURN); keysMap.put(13, Keys.ENTER); keysMap.put(24, Keys.CANCEL); keysMap.put(27, Keys.ESCAPE); keysMap.put(32, Keys.SPACE); keysMap.put(42, Keys.MULTIPLY); keysMap.put(43, Keys.ADD); keysMap.put(44, Keys.SUBTRACT); keysMap.put(56, Keys.DECIMAL); keysMap.put(57, Keys.DIVIDE); keysMap.put(59, Keys.SEMICOLON); keysMap.put(61, Keys.EQUALS); keysMap.put(127, Keys.DELETE); Keys key = keysMap.get(keyCode); if (key == null) { Character c = (char) keyCode; return c.toString(); } return key.toString(); }
From source file:org.keycloak.testsuite.console.page.fragment.AbstractMultipleSelect2.java
License:Apache License
public void select(R value) { pause(500);/*w w w .j ava 2s . com*/ root.click(); pause(500); String id = identity().apply(value); search.sendKeys(id); waitForPageToLoad(); if (result.isEmpty()) { search.sendKeys(Keys.ESCAPE); return; } for (WebElement result : result) { if (result.getText().equalsIgnoreCase(id)) { clickLink(result); return; } } }
From source file:org.labkey.test.pages.signaldata.SignalDataUploadPage.java
License:Apache License
public void uploadIncorrectFile(File file) { uploadFile(file);//from ww w . j a v a 2 s . co m Locator msgBox = Locators.fileNotUploadedMsgBox(file.getName()); _test.waitForElement(msgBox); msgBox.findElement(_test.getWrappedDriver()).sendKeys(Keys.ESCAPE); }
From source file:org.musetest.selenium.values.KeystrokesStringSourceTests.java
License:Open Source License
@Test void testSingle() throws MuseInstantiationException, ValueSourceResolutionError { ValueSourceConfiguration source = ValueSourceConfiguration.forTypeWithSource(KeystrokesStringSource.TYPE_ID, ValueSourceConfiguration.forValue("{ESCAPE}")); Object result = source.createSource(new SimpleProject()).resolveValue(new MockStepExecutionContext()); Assertions.assertEquals(Keys.ESCAPE.toString(), result.toString()); }
From source file:org.musetest.selenium.values.KeystrokesStringSourceTests.java
License:Open Source License
@Test void testDouble() throws MuseInstantiationException, ValueSourceResolutionError { ValueSourceConfiguration source = ValueSourceConfiguration.forTypeWithSource(KeystrokesStringSource.TYPE_ID, ValueSourceConfiguration.forValue("{ESCAPE}{HOME}")); Object result = source.createSource(new SimpleProject()).resolveValue(new MockStepExecutionContext()); Assertions.assertEquals(Keys.ESCAPE.toString() + Keys.HOME.toString(), result.toString()); }
From source file:org.openlmis.pageobjects.FacilityListPage.java
License:Open Source License
public void verifyIndividualFacilityIndicatorColor(String facilityCode, String color) { testWebDriver.waitForElementToAppear(facilityOverAllIndicator); if (color.toLowerCase().equals("RED".toLowerCase())) color = "rgba(203, 64, 64, 1)"; else if (color.toLowerCase().equals("GREEN".toLowerCase())) color = "rgba(69, 182, 0, 1)"; else if (color.toLowerCase().equals("AMBER".toLowerCase())) color = "rgba(240, 165, 19, 1)"; else if (color.toLowerCase().equals("Blue".toLowerCase())) color = "rgba(22, 131, 230, 1)"; clickFacilityListDropDown();/*from ww w. j av a2s. co m*/ testWebDriver.waitForElementToAppear(facilityListTextField); inputFacilitySearch.sendKeys(facilityCode); assertEquals(firstFacilityIndicator.getCssValue("background-color"), color); inputFacilitySearch.clear(); inputFacilitySearch.sendKeys(Keys.ESCAPE); }
From source file:org.richfaces.fragment.inplaceInput.AbstractConfirmOrCancel.java
License:Open Source License
@Override public void cancel() { getInput().sendKeys(Keys.chord(Keys.CONTROL, Keys.ESCAPE)); waitAfterConfirmOrCancel(); }
From source file:org.richfaces.tests.metamer.ftest.richHotKey.TestHotKeyAttributes.java
License:Open Source License
@Test public void testPreventDefaultFalse() { ATTRIBUTES_FIRST.set(HotKeyAttributes.preventDefault, Boolean.FALSE); try {//w w w. j a v a 2 s .c o m testKeyForPreventDefault(Keys.chord(Keys.CONTROL, "f"), "ctrl+f", 1); } finally { firstInput.getInput().sendKeys(Keys.ESCAPE); } }