List of usage examples for org.openqa.selenium Keys ARROW_RIGHT
Keys ARROW_RIGHT
To view the source code for org.openqa.selenium Keys ARROW_RIGHT.
Click Source Link
From source file:org.auraframework.integration.test.components.ui.tabset.TabsetUITest.java
License:Apache License
/** * Test that will verify that the arrows keys work. This is not something that will be run on mobile devices * /* ww w. j a v a 2 s . c o m*/ * IE7/8 don't handle arrows well. */ @ExcludeBrowsers({ BrowserType.ANDROID_PHONE, BrowserType.ANDROID_TABLET, BrowserType.IPHONE, BrowserType.IPAD, BrowserType.IE8, BrowserType.IE7 }) @Test public void testLeftRightUpDownArrows() throws Exception { open(createURL("basic", "false")); // Left/Up and Right/Down Arrows do the samething. Making sure that the result is also the same iterateThroughTabs(Keys.ARROW_RIGHT, Keys.ARROW_LEFT); iterateThroughTabs(Keys.ARROW_DOWN, Keys.ARROW_UP); }
From source file:org.callimachusproject.webdriver.pages.DocEditor.java
License:Apache License
public DocEditor end() { browser.focusInFrameIndex(0, 0); browser.sendKeys(Keys.END); browser.sendKeys(Keys.ARROW_RIGHT); return this; }
From source file:org.eclipse.che.selenium.miscellaneous.FileStructureByKeyboardTest.java
License:Open Source License
@Test public void checkFileStructureByKeyboard() { projectExplorer.waitProjectExplorer(); projectExplorer.openItemByPath(PROJECT_NAME); expandTReeProjectAndOpenClass(JAVA_FILE_NAME); // check work nodes in the 'file structure' by keyboard fileStructure.launchFileStructureFormByKeyboard(); fileStructure.waitFileStructureFormIsOpen(JAVA_FILE_NAME); fileStructure.waitExpectedTextInFileStructure(ITEMS_CLASS); fileStructure.sendCommandByKeyboardInFileStructure(Keys.ARROW_LEFT.toString()); fileStructure.waitExpectedTextIsNotPresentInFileStructure(ITEMS_CLASS); fileStructure.sendCommandByKeyboardInFileStructure(Keys.ARROW_RIGHT.toString()); fileStructure.waitExpectedTextInFileStructure(ITEMS_CLASS_1); fileStructure.selectItemInFileStructure(INNER_CLASS_NAME); fileStructure.waitExpectedTextIsNotPresentInFileStructure(ITEMS_INNER_CLASS); fileStructure.sendCommandByKeyboardInFileStructure(Keys.ARROW_RIGHT.toString()); fileStructure.waitExpectedTextInFileStructure(ITEMS_INNER_CLASS); fileStructure.sendCommandByKeyboardInFileStructure(Keys.ARROW_LEFT.toString()); fileStructure.waitExpectedTextIsNotPresentInFileStructure(ITEMS_INNER_CLASS); fileStructure.sendCommandByKeyboardInFileStructure(Keys.ARROW_RIGHT.toString()); fileStructure.waitExpectedTextInFileStructure(ITEMS_INNER_CLASS); fileStructure.selectItemInFileStructure(INTERFACE_NAME); fileStructure.waitExpectedTextIsNotPresentInFileStructure(ITEMS_INTERFACE); fileStructure.sendCommandByKeyboardInFileStructure(Keys.ARROW_RIGHT.toString()); fileStructure.waitExpectedTextInFileStructure(ITEMS_INTERFACE); fileStructure.sendCommandByKeyboardInFileStructure(Keys.ARROW_LEFT.toString()); fileStructure.waitExpectedTextIsNotPresentInFileStructure(ITEMS_INTERFACE); fileStructure.sendCommandByKeyboardInFileStructure(Keys.ARROW_RIGHT.toString()); fileStructure.waitExpectedTextInFileStructure(ITEMS_INTERFACE); // check go on the root node after 'double click arrow left' fileStructure.sendCommandByKeyboardInFileStructure(Keys.ARROW_LEFT.toString()); fileStructure.sendCommandByKeyboardInFileStructure(Keys.ARROW_LEFT.toString()); fileStructure.sendCommandByKeyboardInFileStructure(Keys.ARROW_LEFT.toString()); fileStructure.waitExpectedTextIsNotPresentInFileStructure(ITEMS_CLASS); fileStructure.sendCommandByKeyboardInFileStructure(Keys.ARROW_RIGHT.toString()); fileStructure.clickOnIconNodeInFileStructure(INTERFACE_NAME); fileStructure.clickOnIconNodeInFileStructure(INNER_CLASS_NAME); fileStructure.waitExpectedTextInFileStructure(ITEMS_CLASS); // check scroll by keyboard fileStructure.selectItemInFileStructure(JAVA_FILE_NAME); fileStructure.waitExpectedTextInFileStructure(ITEMS_CLASS); fileStructure.moveDownToItemInFileStructure("TEN"); //TODO add code scroll up later }
From source file:org.eclipse.che.selenium.miscellaneous.FindUsagesBaseOperationTest.java
License:Open Source License
@Test public void checkFindUsagesBaseOperation() { projectExplorer.waitProjectExplorer(); projectExplorer.waitItem(PROJECT_NAME); projectExplorer.expandPathInProjectExplorerAndOpenFile(PATH_FOR_EXPAND, "AppController.java"); // Check basic operations of the 'find usages' panel editor.selectTabByName("AppController"); editor.setCursorToDefinedLineAndChar(26, 17); menu.runCommand(TestMenuCommandsConstants.Assistant.ASSISTANT, TestMenuCommandsConstants.Assistant.FIND_USAGES); loader.waitOnClosed();/*from w w w . ja v a 2 s . co m*/ findUsages.waitFindUsagesPanelIsOpen(); findUsages.clickFindUsagesTab(); findUsages.waitFindUsegesPanelIsClosed(); findUsages.clickFindUsagesTab(); findUsages.waitFindUsagesPanelIsOpen(); findUsages.waitExpectedTextInFindUsagesPanel(EXPECTED_TEXT); findUsages.waitSelectedElementInFindUsagesPanel("numGuessByUser"); // Check nodes in the 'find usages' panel by 'double click' and click on the icon node findUsages.clickOnIconNodeInFindUsagesPanel(PROJECT_NAME); findUsages.waitExpectedTextIsNotPresentInFindUsagesPanel(EXPECTED_TEXT_1); findUsages.selectNodeInFindUsagesByDoubleClick(PROJECT_NAME); findUsages.waitExpectedTextIsNotPresentInFindUsagesPanel(EXPECTED_TEXT_1); findUsages.selectNodeInFindUsagesByDoubleClick("org.eclipse.qa.examples"); findUsages.selectNodeInFindUsagesByDoubleClick("AppController"); findUsages.selectNodeInFindUsagesByDoubleClick("handleRequest(HttpServletRequest, HttpServletResponse)"); findUsages.waitExpectedTextInFindUsagesPanel(EXPECTED_TEXT_1); findUsages.selectNodeInFindUsagesByDoubleClick("AppController"); findUsages.waitExpectedTextIsNotPresentInFindUsagesPanel(EXPECTED_TEXT_2); findUsages.clickOnIconNodeInFindUsagesPanel("AppController"); findUsages.waitExpectedTextIsNotPresentInFindUsagesPanel(EXPECTED_TEXT_2); findUsages.clickOnIconNodeInFindUsagesPanel("handleRequest(HttpServletRequest, HttpServletResponse)"); findUsages.waitExpectedTextInFindUsagesPanel(EXPECTED_TEXT_2); // Check nodes in the 'find usages' panel by 'Enter' findUsages.selectNodeInFindUsagesPanel(PROJECT_NAME); findUsages.sendCommandByKeyboardInFindUsagespanel(Keys.ENTER.toString()); findUsages.waitExpectedTextIsNotPresentInFindUsagesPanel(EXPECTED_TEXT_1); findUsages.sendCommandByKeyboardInFindUsagespanel(Keys.ENTER.toString()); findUsages.waitExpectedTextIsNotPresentInFindUsagesPanel(EXPECTED_TEXT_1); findUsages.selectNodeInFindUsagesPanel("org.eclipse.qa.examples"); findUsages.sendCommandByKeyboardInFindUsagespanel(Keys.ENTER.toString()); findUsages.selectNodeInFindUsagesPanel("AppController"); findUsages.sendCommandByKeyboardInFindUsagespanel(Keys.ENTER.toString()); findUsages.selectNodeInFindUsagesPanel("handleRequest(HttpServletRequest, HttpServletResponse)"); findUsages.sendCommandByKeyboardInFindUsagespanel(Keys.ENTER.toString()); findUsages.waitExpectedTextInFindUsagesPanel(EXPECTED_TEXT_1); findUsages.selectNodeInFindUsagesPanel("AppController"); findUsages.sendCommandByKeyboardInFindUsagespanel(Keys.ENTER.toString()); findUsages.waitExpectedTextIsNotPresentInFindUsagesPanel(EXPECTED_TEXT_2); findUsages.sendCommandByKeyboardInFindUsagespanel(Keys.ENTER.toString()); findUsages.waitExpectedTextIsNotPresentInFindUsagesPanel(EXPECTED_TEXT_2); findUsages.selectNodeInFindUsagesPanel("handleRequest(HttpServletRequest, HttpServletResponse)"); findUsages.sendCommandByKeyboardInFindUsagespanel(Keys.ENTER.toString()); findUsages.waitExpectedTextInFindUsagesPanel(EXPECTED_TEXT_2); // Check nodes in the 'find usages' panel by keyboard findUsages.selectNodeInFindUsagesPanel("handleRequest(HttpServletRequest, HttpServletResponse)"); findUsages.sendCommandByKeyboardInFindUsagespanel(Keys.ARROW_LEFT.toString()); findUsages.waitExpectedTextIsNotPresentInFindUsagesPanel(EXPECTED_TEXT_2); findUsages.sendCommandByKeyboardInFindUsagespanel(Keys.ARROW_RIGHT.toString()); findUsages.waitExpectedTextInFindUsagesPanel(EXPECTED_TEXT_2); findUsages.sendCommandByKeyboardInFindUsagespanel(Keys.ARROW_UP.toString()); findUsages.sendCommandByKeyboardInFindUsagespanel(Keys.ARROW_UP.toString()); findUsages.sendCommandByKeyboardInFindUsagespanel(Keys.ARROW_UP.toString()); findUsages.sendCommandByKeyboardInFindUsagespanel(Keys.ARROW_LEFT.toString()); findUsages.waitExpectedTextIsNotPresentInFindUsagesPanel(EXPECTED_TEXT_1); findUsages.sendCommandByKeyboardInFindUsagespanel(Keys.ARROW_RIGHT.toString()); findUsages.waitExpectedTextIsNotPresentInFindUsagesPanel(EXPECTED_TEXT_1); findUsages.sendCommandByKeyboardInFindUsagespanel(Keys.ARROW_DOWN.toString()); findUsages.sendCommandByKeyboardInFindUsagespanel(Keys.ARROW_RIGHT.toString()); findUsages.sendCommandByKeyboardInFindUsagespanel(Keys.ARROW_DOWN.toString()); findUsages.sendCommandByKeyboardInFindUsagespanel(Keys.ARROW_RIGHT.toString()); findUsages.sendCommandByKeyboardInFindUsagespanel(Keys.ARROW_DOWN.toString()); findUsages.sendCommandByKeyboardInFindUsagespanel(Keys.ARROW_RIGHT.toString()); findUsages.waitExpectedTextInFindUsagesPanel(EXPECTED_TEXT_2); findUsages.waitExpectedTextInFindUsagesPanel(EXPECTED_TEXT_1); // Check the found items in the editor findUsages.selectHighlightedItemInFindUsagesByDoubleClick(29); editor.typeTextIntoEditor(Keys.ARROW_LEFT.toString()); editor.expectedNumberOfActiveLine(29); editor.waitTextElementsActiveLine("numGuessByUser"); findUsages.selectNodeInFindUsagesPanel("handleRequest(HttpServletRequest, HttpServletResponse)"); findUsages.sendCommandByKeyboardInFindUsagespanel(Keys.ARROW_DOWN.toString()); findUsages.sendCommandByKeyboardInFindUsagespanel(Keys.ARROW_DOWN.toString()); findUsages.sendCommandByKeyboardInFindUsagespanel(Keys.ARROW_DOWN.toString()); findUsages.sendCommandByKeyboardInFindUsagespanel(Keys.ENTER.toString()); editor.typeTextIntoEditor(Keys.ARROW_LEFT.toString()); editor.expectedNumberOfActiveLine(33); editor.waitTextElementsActiveLine("numGuessByUser"); }
From source file:org.eclipse.che.selenium.miscellaneous.WorkingWithTerminalTest.java
License:Open Source License
@Test(priority = 13) public void shouldEditFileIntoMCEdit() { openMC("/projects/" + PROJECT_NAME); //check End, Home, F4, Delete keys terminal.typeIntoTerminal("" + Keys.END + Keys.ENTER + Keys.END + Keys.ARROW_UP + Keys.F4); //select editor terminal.typeIntoTerminal(valueOf(1) + Keys.ENTER); terminal.waitExpectedTextIntoTerminal( "README.md " + "[----] 0 L:[ 1+ 0 1/ 1] *(0 / 21b) 0035 0x023"); terminal.typeIntoTerminal("<!-some comment->"); terminal.typeIntoTerminal(//w ww. j ava 2 s.c om "" + Keys.HOME + Keys.ARROW_RIGHT + Keys.ARROW_RIGHT + Keys.ARROW_RIGHT + Keys.DELETE); terminal.waitExpectedTextIntoTerminal("<!-ome comment->"); }
From source file:org.openfaces.component.treetable.TreeTableTest.java
License:LGPL
/** * Check TreeTable single selection/*from ww w . j av a2 s. c om*/ */ @Test @Ignore public void testSingleSelectionAndKeyboardNavigation() { closeBrowser(); testAppFunctionalPage("/components/treetable/treeTableSingleSelection.jsf"); /*check selection and keyboard navigation on the simple TreeTable*/ Actions click = new Actions(getDriver()) .moveToElement(getDriver().findElement(By.id("formID:singleSelectionTreeTableID:0:categoryID"))) .click(); click.build().perform(); ElementInspector emptyElement = element("empty"); ElementInspector treeTable = element("formID:singleSelectionTreeTableID"); treeTable.focus(); for (int i = 1; i < 26; i++) { if (i == 1 || i == 4 || i == 16 || i == 19 || i == 21 || i == 24) { //click right arrow to expand first TreeTable node new Actions(getDriver()).sendKeys(Keys.ARROW_RIGHT).build().perform(); OpenFacesAjaxLoadingMode.getInstance().waitForLoad(); } //get selected index value emptyElement.assertText(String.valueOf(i - 1)); //click down arrow new Actions(getDriver()).sendKeys(Keys.ARROW_DOWN).build().perform(); } //check mouse selection for the same TreeTable element("formID:singleSelectionTreeTableID:1:categoryID").click(); emptyElement.assertText("3"); element("formID:singleSelectionTreeTableID:4_1:nameID").click(); emptyElement.assertText("22"); /*Check TreeTable with defined 'nodePath' and 'nodeData' attributes*/ element("formID:singleNodePathSelectionTreeTableID:3:categoryID").click(); ElementInspector selectionNodePath = element("selectionNodePathID"); String indexBeforeSubmitNodePathTreeTable = selectionNodePath.text(); element("formID:singleNodeDataSelectionTreeTableID:1:categoryID").keyPress(KeyEvent.VK_RIGHT); OpenFacesAjaxLoadingMode.getInstance().waitForLoad(); treeTable.keyPress(KeyEvent.VK_DOWN); ElementInspector selectionNodeData = element("selectionNodeDataID"); String indexBeforeSubmitNodeDataTreeTable = selectionNodeData.text(); element("formID:submitID").clickAndWait(); selectionNodePath.assertText(indexBeforeSubmitNodePathTreeTable); selectionNodeData.assertText(indexBeforeSubmitNodeDataTreeTable); }
From source file:org.openfaces.component.treetable.TreeTableTest.java
License:LGPL
/** * Check TreeTable multiple selection//from w w w .j a v a 2 s . c om */ //todo: add checking multiple selection functionality with the 'Ctrl' key @Test @Ignore public void testMultipleSelectionAndKeyboardNavigation() { testAppFunctionalPage("/components/treetable/treeTableMultipleSelection.jsf"); ElementInspector categoryOutput = element("formID:multipleSelectionTreeTableID:0:categoryID"); new Actions(getDriver()) .moveToElement(getDriver().findElement(By.id("formID:multipleSelectionTreeTableID:0:categoryID"))) .click().build().perform(); TreeTableInspector multipleSelectionTreeTable = treeTable("formID:multipleSelectionTreeTableID"); multipleSelectionTreeTable.focus(); /*check keyboard navigation and selection*/ //select root nodes for (int i = 0; i < 5; i++) { createEvent(multipleSelectionTreeTable, null, EventType.KEY, "keypress", KeyEvent.VK_DOWN, true); } ElementInspector emptyElement = element("empty"); emptyElement.assertText(" 0 1 2 3 4 5"); for (int i = 0; i < 6; i++) { multipleSelectionTreeTable.getElementsByTagName("img").get(i) .clickAndWait(OpenFacesAjaxLoadingMode.getInstance()); } categoryOutput.click(); for (int i = 0; i < 25; i++) { createEvent(multipleSelectionTreeTable, null, EventType.KEY, "keypress", KeyEvent.VK_DOWN, true); } emptyElement.assertText(" 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24"); for (int i = 0; i < 6; i++) { multipleSelectionTreeTable.getElementsByTagName("img").get(i) .clickAndWait(OpenFacesAjaxLoadingMode.getInstance()); } categoryOutput.click(); for (int i = 0; i < 5; i++) { createEvent(element("formID:multipleSelectionTreeTableID"), null, EventType.KEY, "keypress", KeyEvent.VK_DOWN, true); } emptyElement.assertText(" 0 3 15 18 20 23"); /*check 'nodePaths' and 'nodeDatas' attributes*/ //verify is attributes took right initial values ElementInspector nodePathsOutput = element("formID:nodePathsID"); nodePathsOutput.assertText("Document BrowsingNetwork Access"); ElementInspector nodeDataOutput = element("formID:nodeDatasID"); nodeDataOutput.assertText("Document BrowsingDocument Deletion"); ElementInspector selectionNodePathsDiv = element("selectionNodePathsID"); selectionNodePathsDiv.assertText(" 1 5"); ElementInspector selectionNodeDataDiv = element("selectionNodeDatasID"); selectionNodeDataDiv.assertText(" 1 4"); //check root nodes element("formID:multipleNodePathsSelectionTreeTableID:0:categoryID").click(); TreeTableInspector multipleNodePathsTreeTable = treeTable("formID:multipleNodePathsSelectionTreeTableID"); new Actions(getDriver()) .moveToElement(getDriver().findElement(By.xpath(multipleNodePathsTreeTable.getXPath()))) .sendKeys(Keys.ARROW_DOWN).build().perform(); element("formID:multipleNodeDatasSelectionTreeTableID:0:categoryID").click(); TreeTableInspector multipleNodeDataTreeTable = treeTable("formID:multipleNodeDatasSelectionTreeTableID"); new Actions(getDriver()) .moveToElement(getDriver().findElement(By.xpath(multipleNodeDataTreeTable.getXPath()))) .sendKeys(Keys.ARROW_DOWN).build().perform(); //check root + expanded child nodes element("formID:multipleNodePathsSelectionTreeTableID:4:categoryID").click(); //click right arrow new Actions(getDriver()) .moveToElement(getDriver().findElement(By.xpath(multipleNodeDataTreeTable.getXPath()))) .sendKeys(Keys.ARROW_RIGHT).build().perform(); OpenFacesAjaxLoadingMode.getInstance().waitForLoad(); for (int i = 0; i < 3; i++) { createEvent(multipleNodePathsTreeTable, null, EventType.KEY, "keypress", KeyEvent.VK_DOWN, true); } new Actions(getDriver()) .moveToElement( getDriver().findElement(By.id("formID:multipleNodeDatasSelectionTreeTableID:2:categoryID"))) .click().build().perform(); multipleNodeDataTreeTable.keyPress(Keys.ARROW_RIGHT); OpenFacesAjaxLoadingMode.getInstance().waitForLoad(); for (int i = 0; i < 3; i++) { createEvent(multipleNodeDataTreeTable, null, EventType.KEY, "keypress", KeyEvent.VK_DOWN, true); } element("formID:submitID").clickAndWait(); nodePathsOutput.assertText("Document DeletionSemen SemenychIvan IvanychNetwork Access"); nodeDataOutput.assertText("Document CreationAdministratorIvan IvanychDocument Modification"); selectionNodePathsDiv.assertText(" 4 5 6 7"); selectionNodeDataDiv.assertText(" 2 3 4 5"); //todo: checking with collapsed child node should be added after fix of 'JSFC-2603' }
From source file:org.openlmis.pageobjects.ProgramProductISAPage.java
License:Open Source License
public void enterValueInRatioTextField(String ratio) { testWebDriver.waitForElementToAppear(ratioTextBox); ratioTextBox.sendKeys(Keys.ARROW_RIGHT); ratioTextBox.sendKeys(Keys.BACK_SPACE); ratioTextBox.sendKeys(ratio);// w ww.j a v a2s . co m }
From source file:org.openlmis.pageobjects.RegimenTemplateConfigPage.java
License:Open Source License
public void sendKeys(WebElement locator, String value) { int length = testWebDriver.getAttribute(locator, "value").length(); for (int i = 0; i < length; i++) { locator.sendKeys(Keys.ARROW_RIGHT); }/* w w w . j a v a2s.c om*/ for (int i = 0; i < length; i++) { locator.sendKeys("\u0008"); } locator.sendKeys(value); }
From source file:org.richfaces.tests.metamer.ftest.richCalendar.TestCalendarModel.java
License:Open Source License
@Test @IssueTracking("https://issues.jboss.org/browse/RF-14199") public void testDisabledDayCannotBePickedByKeyboard() { DateTime referenceDate = new DateTime().withYear(2015).withMonthOfYear(11).withDayOfMonth(2) .withHourOfDay(12).withMinuteOfHour(0); // set reference date Graphene.guardAjax(popupCalendar).setDateTime(referenceDate); performStabilizationWorkaround();//from w w w .j a v a2 s . c o m popupCalendar.openPopup(); checkSelectedDate(referenceDate); // try to select tuesday (disabled) keyboard.sendKeys(Keys.ARROW_RIGHT); keyboard.sendKeys(Keys.ENTER); assertTrue(popupCalendar.getPopup().isVisible()); // check date is still the same (no move through enabled and already not selected days) checkSelectedDate(referenceDate); // try to select sunday (disabled) keyboard.sendKeys(Keys.ARROW_LEFT); keyboard.sendKeys(Keys.ARROW_LEFT); keyboard.sendKeys(Keys.ENTER); assertTrue(popupCalendar.getPopup().isVisible()); // check date is still the same (no move through enabled and already not selected days) checkSelectedDate(referenceDate); // try to select saturday from previous month (disabled) Graphene.guardAjax(keyboard).sendKeys(Keys.ARROW_LEFT);// move to previous month will trigger an ajax request keyboard.sendKeys(Keys.ENTER); assertTrue(popupCalendar.getPopup().isVisible()); // check date is still the same (no move through enabled and already not selected days) checkSelectedDate(referenceDate); // try to select thursday from previous year (disabled) Graphene.guardAjax(keyboard).sendKeys(Keys.chord(Keys.SHIFT, Keys.PAGE_UP));// move to previous year will trigger an ajax request keyboard.sendKeys(Keys.ARROW_LEFT); keyboard.sendKeys(Keys.ENTER); assertTrue(popupCalendar.getPopup().isVisible()); // check selected date has changed (day moved to friday when the year was switched) // 2x to the left and 1x to previous year referenceDate = referenceDate.minusDays(2).minusYears(1); checkSelectedDate(referenceDate); // finally, select wednesday (enabled) Graphene.guardAjax(keyboard).sendKeys(Keys.ARROW_LEFT); keyboard.sendKeys(Keys.ENTER); popupCalendar.getPopup().waitUntilIsNotVisible().perform(); referenceDate = referenceDate.withYear(2014).withMonthOfYear(10).withDayOfMonth(29); checkSelectedDate(referenceDate); }