Example usage for org.openqa.selenium Keys TAB

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

Introduction

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

Prototype

Keys TAB

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

Click Source Link

Usage

From source file:org.alfresco.po.share.cmm.admin.CreateNewPropertyPopUp.java

License:Open Source License

/**
 * Sets the constraint field./*  www .j a  va2 s  .c  o m*/
 * 
 * @param value the value
 * @return the CreateNewPropertyPopUp
 */
public void setConstraintField(String value) {
    PageUtils.checkMandatoryParam("value", value);
    try {
        WebElement constraintType = findAndWait(CONSTRAINT_FIELD);
        SelectList list = new SelectList(driver, constraintType);
        list.selectValue(value, true);
        // Do not Remove: // Specifically added to get the focus on next field / get it visible if the screen-size limits the PropertyPopup fields displayed
        constraintType.sendKeys(Keys.TAB);
    } catch (TimeoutException toe) {
        throw new PageOperationException("Not visible Element: CONSTRAINT_FIELD", toe);
    }
}

From source file:org.alfresco.po.share.cmm.admin.CreateNewPropertyPopUp.java

License:Open Source License

/**
 * Sets the constraint allowed values field.
 * //from  w w w .  j  ava  2s  .  com
 * @param value the value
 * @return the CreateNewPropertyPopUp
 */
public void setConstraintAllowedValuesField(String value) {
    try {
        WebElement allowedValues = findFirstDisplayedElement(CONSTRAINT_ALLOWED_VALUES_FIELD);
        allowedValues.sendKeys(value, Keys.TAB);
    } catch (TimeoutException toe) {
        throw new PageOperationException("Not visible Element: CONSTRAINT_ALLOWED_VALUES_FIELD ", toe);
    }
}

From source file:org.alfresco.po.share.cmm.admin.CreateNewPropertyPopUp.java

License:Open Source License

/**
 * Click the constraint sorted field.//from   w  w  w .j  av  a 2s  .c o  m
 * 
 * @return the CreateNewPropertyPopUp
 */
public void clickConstraintSortedField() {
    try {
        WebElement checkBoxParent = findAndWait(CONSTRAINT_SORTED_FIELD);
        WebElement checkBox = checkBoxParent.findElement(By.cssSelector("input"));
        checkBox.click();
        // Added to get the focus on <Create> button
        checkBox.sendKeys(Keys.TAB);
        if (!checkBox.isSelected()) {
            throw new PageOperationException("Unable to select CheckBox: " + CONSTRAINT_SORTED_FIELD);
        }
    } catch (TimeoutException toe) {
        throw new PageOperationException("Not visible Element: CONSTRAINT_SORTED_FIELD ", toe);
    }
}

From source file:org.alfresco.po.share.cmm.admin.CreateNewPropertyPopUp.java

License:Open Source License

/**
 * Sets the indexing text field.//from   w  ww  .java 2s  . c om
 * 
 * @param value the value
 * @return the CreateNewPropertyPopUp
 */
public void setIndexingTextField(String value) {
    PageUtils.checkMandatoryParam("value", value);
    try {
        WebElement indexingType = findAndWait(INDEXING_TEXT_FIELD);
        SelectList list = new SelectList(driver, indexingType);
        list.selectValue(value, true);
        indexingType.sendKeys(Keys.TAB);
    } catch (TimeoutException toe) {
        throw new PageOperationException("Not visible Element: INDEXING_TEXT_FIELD ", toe);
    }
}

From source file:org.alfresco.po.share.cmm.admin.CreateNewPropertyPopUp.java

License:Open Source License

/**
 * Sets the indexing boolean field./*w  w w. j  a  va  2  s  .c o  m*/
 * 
 * @param value the value
 * @return the CreateNewPropertyPopUp
 */
public void setIndexingBooleanField(String value) {
    PageUtils.checkMandatoryParam("value", value);
    try {
        WebElement indexingType = findAndWait(INDEXING_BOOLEAN_FIELD);
        SelectList list = new SelectList(driver, indexingType);
        list.selectValue(value, true);
        indexingType.sendKeys(Keys.TAB);
    } catch (TimeoutException toe) {
        throw new PageOperationException("Not visible Element: INDEXING_BOOLEAN_FIELD ", toe);
    }
}

From source file:org.alfresco.po.share.cmm.admin.CreateNewPropertyPopUp.java

License:Open Source License

/**
 * Sets the indexing non text field./*from www .  j  a  v  a2  s . co  m*/
 * 
 * @param value the value
 * @return the CreateNewPropertyPopUp
 */
public void setIndexingNonTextField(String value) {
    PageUtils.checkMandatoryParam("value", value);
    try {
        WebElement indexingType = findAndWait(INDEXING_NONTEXT_FIELD);
        SelectList list = new SelectList(driver, indexingType);
        list.selectValue(value, true);
        indexingType.sendKeys(Keys.TAB);
    } catch (TimeoutException toe) {
        throw new PageOperationException("Not visible Element: INDEXING_NONTEXT_FIELD ", toe);
    }
}

From source file:org.alfresco.po.share.cmm.admin.CreateNewPropertyPopUp.java

License:Open Source License

private SelectList getIndexingOptionElement() {
    try {//  ww w.  ja va  2  s .c  om
        WebElement indexType = findFirstDisplayedElement(INDEX_FIELD);
        indexType.sendKeys(Keys.TAB);
        return new SelectList(driver, indexType);
    } catch (NoSuchElementException nse) {
        throw new PageOperationException("Not visible Element: Index Field", nse);
    }
}

From source file:org.alfresco.po.share.DashBoardPageTest.java

License:Open Source License

@Test(dependsOnMethods = "refreshPage", enabled = false, groups = "nonGrid")
public void testKeysForHeaderBar() throws Exception {
    driver.navigate().refresh();/*  ww  w. j  av a  2s  .c  o  m*/
    dashBoard.inputFromKeyborad(Keys.TAB);
    dashBoard.inputFromKeyborad(Keys.ARROW_RIGHT);
    dashBoard.inputFromKeyborad(Keys.ARROW_RIGHT);
    dashBoard.inputFromKeyborad(Keys.RETURN);
    Assert.assertTrue(resolvePage(driver).render() instanceof SharedFilesPage);
}

From source file:org.alfresco.po.share.site.CreateSitePage.java

License:Open Source License

/**
 * Set the Name of the site//from   w w w.ja v a 2  s. co  m
 * 
 * @param siteName String site name
 */

public void setSiteName(String siteName) {
    WebElement inputSiteName = findAndWait(INPUT_TITLE);
    inputSiteName.clear();
    inputSiteName.sendKeys(siteName);
    inputSiteName.sendKeys(Keys.TAB);
}

From source file:org.alfresco.po.share.site.CreateSitePage.java

License:Open Source License

/**
 * Set the URL of the site//from ww  w.ja v a 2s .  co  m
 * 
 * @param siteURL String site name
 */

public void setSiteURL(String siteURL) {
    WebElement inputSiteURL = driver.findElement(By.name("shortName"));

    inputSiteURL.clear();
    inputSiteURL.sendKeys(siteURL);
    inputSiteURL.sendKeys(Keys.TAB);
}