Example usage for org.openqa.selenium Keys PAGE_DOWN

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

Introduction

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

Prototype

Keys PAGE_DOWN

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

Click Source Link

Usage

From source file:com.gargoylesoftware.htmlunit.selenium.TypingTest.java

License:Apache License

/**
 * A test.// w w  w.j  a  v a  2 s.  c o m
 */
@Test
public void testArrowKeysAndPageUpAndDown() {
    final WebDriver driver = getWebDriver("/javascriptPage.html");

    final WebElement element = driver.findElement(By.id("keyReporter"));

    element.sendKeys(
            "a" + Keys.LEFT + "b" + Keys.RIGHT + Keys.UP + Keys.DOWN + Keys.PAGE_UP + Keys.PAGE_DOWN + "1");
    assertThat(element.getAttribute("value"), is("ba1"));
}

From source file:com.gargoylesoftware.htmlunit.selenium.TypingTest.java

License:Apache License

/**
 * A test.//from w  w  w  .ja  v a2 s  .  com
 */
@Test
public void homeAndEndAndPageUpAndPageDownKeys() {
    final WebDriver driver = getWebDriver("/javascriptPage.html");

    final WebElement element = driver.findElement(By.id("keyReporter"));

    element.sendKeys("abc" + Keys.HOME + "0" + Keys.LEFT + Keys.RIGHT + Keys.PAGE_UP + Keys.PAGE_DOWN + Keys.END
            + "1" + Keys.HOME + "0" + Keys.PAGE_UP + Keys.END + "111" + Keys.HOME + "00");
    assertThat(element.getAttribute("value"), is("0000abc1111"));
}

From source file:com.hotwire.selenium.desktop.us.results.car.fragments.fareFinder.CcfCarFareFinder.java

License:Open Source License

@Override
public CarFareFinder setPickUpTime(String time) {
    ccfPickupTime.click();/* ww w.  j  a  va2s.c o  m*/
    ccfPickupTime.sendKeys(Keys.PAGE_DOWN);
    String transformed = (time == null) ? "noon" : time.replace("am", " AM").replace("pm", " PM");
    getWebDriver()
            .findElement(
                    By.xpath("//ul[@id='pickupTime-menu']" + "//a[contains(text(), '" + transformed + "')]"))
            .click();
    return this;
}

From source file:com.hotwire.selenium.desktop.us.results.car.fragments.fareFinder.CcfCarFareFinder.java

License:Open Source License

@Override
public CarFareFinder setDropOffTime(String time) {
    ccfDropOffTime.click();/*from   w  w w  .j  a  v  a  2s.co  m*/
    ccfDropOffTime.sendKeys(Keys.PAGE_DOWN);
    String transformed = (time == null) ? "noon" : time.replace("am", " AM").replace("pm", " PM");
    getWebDriver()
            .findElement(
                    By.xpath("//ul[@id='dropOffTime-menu']" + "//a[contains(text(), '" + transformed + "')]"))
            .click();
    return this;
}

From source file:com.provenir.automation.framework.helper.AdminPage.java

public void selectRule() throws InterruptedException {

    Thread.sleep(3000);/*www  .ja  v  a2 s.c  o m*/
    List<WebElement> upperLinks = driver
            .findElements(By.xpath("//*[@id='securityData']/table/tbody/tr[11]/td[5]/div[3]/ul/li"));

    List<WebElement> ele1 = driver
            .findElements(By.xpath("//*[@id='securityData']//*[@class='RepoFolderTreeClass']"));
    WebElement ele = ele1.get(0);
    ele.findElement(By.xpath("//*[text()='Rules']")).click();
    Thread.sleep(1000);
    WebElement e = driver.findElement(By.xpath("//div[@class='RepoFolderTreeClass']"));
    e.sendKeys(Keys.PAGE_DOWN);
    ele.findElement(By.xpath("//*[text()='Rules']/..//*[text()='RuleBasedSecurity']")).click();
    Thread.sleep(1000);
    ele.findElement(By.xpath(
            "//*[text()='Rules']/..//*[text()='RuleBasedSecurity']/..//*[text()='SimpleReadPermission']"))
            .click();
}

From source file:com.provenir.automation.framework.helper.AdminPage.java

public void select5MRule() throws InterruptedException {
    Thread.sleep(3000);/*w ww .ja  va 2s. c  om*/
    List<WebElement> upperLinks = driver.findElements(
            By.xpath("//*[@id='securityData']/table/tbody/tr[2]/td/table/tbody/tr[1]/td[5]/input[2]"));
    List<WebElement> ele1 = driver
            .findElements(By.xpath("//*[@id='securityData']//*[@class='RepoFolderTreeClass']"));
    WebElement ele = ele1.get(0);
    ele.findElement(By.xpath("//*[text()='Rules']")).click();
    Thread.sleep(1000);
    WebElement e = driver.findElement(By.xpath("//div[@class='RepoFolderTreeClass']"));
    e.sendKeys(Keys.PAGE_DOWN);
    ele.findElement(By.xpath("//*[text()='Rules']/..//*[text()='RuleBasedSecurity']")).click();
    Thread.sleep(1000);
    ele.findElement(By.xpath(
            "//*[text()='Rules']/..//*[text()='RuleBasedSecurity']/..//*[text()='Credit360_ProposedAmtGrt5M_RlCdNotEqlCrdOfcr_Read_Edit']"))
            .click();
}

From source file:com.provenir.automation.framework.helper.AdminPage.java

public void select5MRuleForBookingDetails() throws InterruptedException {
    Thread.sleep(3000);//from w  w  w.  j  a v a 2s  .  c  om
    List<WebElement> ele1 = driver
            .findElements(By.xpath("//*[@id='securityData']//*[@class='RepoFolderTreeClass']"));
    WebElement ele = ele1.get(0);
    ele.findElement(By.xpath("//*[text()='Rules']")).click();
    Thread.sleep(1000);
    WebElement e = driver.findElement(By.xpath("//div[@class='RepoFolderTreeClass']"));
    e.sendKeys(Keys.PAGE_DOWN);
    ele.findElement(By.xpath("//*[text()='Rules']/..//*[text()='RuleBasedSecurity']")).click();
    Thread.sleep(1000);
    e.sendKeys(Keys.PAGE_DOWN);
    ele.findElement(By.xpath(
            "//*[text()='Rules']/..//*[text()='RuleBasedSecurity']/..//*[text()='Credit360_ProposedAmtGrt5M_Hide_Read']"))
            .click();
}

From source file:com.thoughtworks.selenium.webdriven.commands.SendKeys.java

License:Apache License

@Override
protected Void handleSeleneseCommand(WebDriver driver, String locator, String value) {
    alertOverride.replaceAlertMethod(driver);

    value = value.replace("${KEY_ALT}", Keys.ALT);
    value = value.replace("${KEY_CONTROL}", Keys.CONTROL);
    value = value.replace("${KEY_CTRL}", Keys.CONTROL);
    value = value.replace("${KEY_META}", Keys.META);
    value = value.replace("${KEY_COMMAND}", Keys.COMMAND);
    value = value.replace("${KEY_SHIFT}", Keys.SHIFT);

    value = value.replace("${KEY_BACKSPACE}", Keys.BACK_SPACE);
    value = value.replace("${KEY_BKSP}", Keys.BACK_SPACE);
    value = value.replace("${KEY_DELETE}", Keys.DELETE);
    value = value.replace("${KEY_DEL}", Keys.DELETE);
    value = value.replace("${KEY_ENTER}", Keys.ENTER);
    value = value.replace("${KEY_EQUALS}", Keys.EQUALS);
    value = value.replace("${KEY_ESCAPE}", Keys.ESCAPE);
    value = value.replace("${KEY_ESC}", Keys.ESCAPE);
    value = value.replace("${KEY_INSERT}", Keys.INSERT);
    value = value.replace("${KEY_INS}", Keys.INSERT);
    value = value.replace("${KEY_PAUSE}", Keys.PAUSE);
    value = value.replace("${KEY_SEMICOLON}", Keys.SEMICOLON);
    value = value.replace("${KEY_SPACE}", Keys.SPACE);
    value = value.replace("${KEY_TAB}", Keys.TAB);

    value = value.replace("${KEY_LEFT}", Keys.LEFT);
    value = value.replace("${KEY_UP}", Keys.UP);
    value = value.replace("${KEY_RIGHT}", Keys.RIGHT);
    value = value.replace("${KEY_DOWN}", Keys.DOWN);
    value = value.replace("${KEY_PAGE_UP}", Keys.PAGE_UP);
    value = value.replace("${KEY_PGUP}", Keys.PAGE_UP);
    value = value.replace("${KEY_PAGE_DOWN}", Keys.PAGE_DOWN);
    value = value.replace("${KEY_PGDN}", Keys.PAGE_DOWN);
    value = value.replace("${KEY_END}", Keys.END);
    value = value.replace("${KEY_HOME}", Keys.HOME);

    value = value.replace("${KEY_NUMPAD0}", Keys.NUMPAD0);
    value = value.replace("${KEY_N0}", Keys.NUMPAD0);
    value = value.replace("${KEY_NUMPAD1}", Keys.NUMPAD1);
    value = value.replace("${KEY_N1}", Keys.NUMPAD1);
    value = value.replace("${KEY_NUMPAD2}", Keys.NUMPAD2);
    value = value.replace("${KEY_N2}", Keys.NUMPAD2);
    value = value.replace("${KEY_NUMPAD3}", Keys.NUMPAD3);
    value = value.replace("${KEY_N3}", Keys.NUMPAD3);
    value = value.replace("${KEY_NUMPAD4}", Keys.NUMPAD4);
    value = value.replace("${KEY_N4}", Keys.NUMPAD4);
    value = value.replace("${KEY_NUMPAD5}", Keys.NUMPAD5);
    value = value.replace("${KEY_N5}", Keys.NUMPAD5);
    value = value.replace("${KEY_NUMPAD6}", Keys.NUMPAD6);
    value = value.replace("${KEY_N6}", Keys.NUMPAD6);
    value = value.replace("${KEY_NUMPAD7}", Keys.NUMPAD7);
    value = value.replace("${KEY_N7}", Keys.NUMPAD7);
    value = value.replace("${KEY_NUMPAD8}", Keys.NUMPAD8);
    value = value.replace("${KEY_N8}", Keys.NUMPAD8);
    value = value.replace("${KEY_NUMPAD9}", Keys.NUMPAD9);
    value = value.replace("${KEY_N9}", Keys.NUMPAD9);
    value = value.replace("${KEY_ADD}", Keys.ADD);
    value = value.replace("${KEY_NUM_PLUS}", Keys.ADD);
    value = value.replace("${KEY_DECIMAL}", Keys.DECIMAL);
    value = value.replace("${KEY_NUM_PERIOD}", Keys.DECIMAL);
    value = value.replace("${KEY_DIVIDE}", Keys.DIVIDE);
    value = value.replace("${KEY_NUM_DIVISION}", Keys.DIVIDE);
    value = value.replace("${KEY_MULTIPLY}", Keys.MULTIPLY);
    value = value.replace("${KEY_NUM_MULTIPLY}", Keys.MULTIPLY);
    value = value.replace("${KEY_SEPARATOR}", Keys.SEPARATOR);
    value = value.replace("${KEY_SEP}", Keys.SEPARATOR);
    value = value.replace("${KEY_SUBTRACT}", Keys.SUBTRACT);
    value = value.replace("${KEY_NUM_MINUS}", Keys.SUBTRACT);

    value = value.replace("${KEY_F1}", Keys.F1);
    value = value.replace("${KEY_F2}", Keys.F2);
    value = value.replace("${KEY_F3}", Keys.F3);
    value = value.replace("${KEY_F4}", Keys.F4);
    value = value.replace("${KEY_F5}", Keys.F5);
    value = value.replace("${KEY_F6}", Keys.F6);
    value = value.replace("${KEY_F7}", Keys.F7);
    value = value.replace("${KEY_F8}", Keys.F8);
    value = value.replace("${KEY_F9}", Keys.F9);
    value = value.replace("${KEY_F10}", Keys.F10);
    value = value.replace("${KEY_F11}", Keys.F11);
    value = value.replace("${KEY_F12}", Keys.F12);

    finder.findElement(driver, locator).sendKeys(value);

    return null;//  w  ww.j a v a  2 s.  c  o m
}

From source file:com.vaadin.tests.components.grid.basicfeatures.server.GridKeyboardNavigationTest.java

License:Apache License

@Test
public void testPageUpPageDown() throws Exception {
    openTestURL();/*  ww w. j  a  v  a2 s  .  c  om*/

    selectMenuPath("Component", "Size", "HeightMode Row");

    getGridElement().getCell(9, 2).click();
    new Actions(getDriver()).sendKeys(Keys.PAGE_DOWN).perform();
    assertTrue("Row 17 did not become visible", isElementPresent(By.xpath("//td[text() = '(17, 2)']")));

    new Actions(getDriver()).sendKeys(Keys.PAGE_DOWN).perform();
    assertTrue("Row 25 did not become visible", isElementPresent(By.xpath("//td[text() = '(25, 2)']")));
    checkFocusedCell(29, 2, 4);

    getGridElement().getCell(41, 2).click();
    new Actions(getDriver()).sendKeys(Keys.PAGE_UP).perform();
    assertTrue("Row 33 did not become visible", isElementPresent(By.xpath("//td[text() = '(33, 2)']")));

    new Actions(getDriver()).sendKeys(Keys.PAGE_UP).perform();
    assertTrue("Row 25 did not become visible", isElementPresent(By.xpath("//td[text() = '(25, 2)']")));
    checkFocusedCell(21, 2, 4);
}

From source file:org.auraframework.components.ui.inputDate.BaseInputDateUITester.java

License:Apache License

@ExcludeBrowsers({ BrowserType.IE9, BrowserType.IE10, BrowserType.ANDROID_PHONE, BrowserType.ANDROID_TABLET,
        BrowserType.IPAD, BrowserType.IPHONE })
public void testPageUpDownYear() throws Exception {
    DateFormat formatter = new SimpleDateFormat(DATE_FORMAT_STR);
    open(URL);/* w w w  .j a  v a2  s .  c  om*/
    // Calendar used to get current date
    GregorianCalendar cal = new GregorianCalendar();
    // Running test, Increasing year
    String result = pageUpDownHelper(10, Keys.SHIFT + "" + Keys.PAGE_UP);

    // Moving calendar to match corresponding action of test and formatting date
    cal.setTime(formatter.parse(TEST_DATE_TO_USE));
    cal.add(Calendar.YEAR, -10);

    // Formatting date to match out of test
    String fmt = new SimpleDateFormat(DATE_FORMAT_STR).format(cal.getTime());

    // Making sure test result and true calendar outcome match
    assertEquals("Shift + Page up did not go to the correct date", fmt, result);

    // Resetting calendar
    cal = new GregorianCalendar();

    // Running test, decreasing month
    result = pageUpDownHelper(15, Keys.SHIFT + "" + Keys.PAGE_DOWN);

    // Moving calendar to match corresponding action of test and formatting date
    cal.setTime(formatter.parse(TEST_DATE_TO_USE));
    cal.add(Calendar.YEAR, 15);
    fmt = new SimpleDateFormat(DATE_FORMAT_STR).format(cal.getTime());

    // Making sure test result and true calendar outcome match
    assertEquals("shift + Page Down did not find the correct date", fmt, result);
}