Example usage for org.openqa.selenium WebElement clear

List of usage examples for org.openqa.selenium WebElement clear

Introduction

In this page you can find the example usage for org.openqa.selenium WebElement clear.

Prototype

void clear();

Source Link

Document

If this element is a form entry element, this will reset its value.

Usage

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

License:Open Source License

/**
 * Enter VerifyPassword.//  w ww.j  av  a2s.  c o m
 */
public void inputVerifyPassword(String text) {
    WebElement input = findAndWait(By.cssSelector(VERIFY_PASSWORD));
    input.clear();
    input.sendKeys(text);
}

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

License:Open Source License

/**
 * Enter Quota.//  w w  w  .  j  ava 2 s . com
 */
public void inputQuota(String text) {
    WebElement input = findAndWait(By.cssSelector(USER_QUOTA));
    input.clear();
    input.sendKeys(text);
}

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

License:Open Source License

/**
 * Enter the search text is group finder text box and clicks Search on the new user page.
 *
 * @param user String name//from   www.j  ava 2s .co m
 * @return UserSearchPage page response
 */
public HtmlPage searchGroup(final String user) {
    try {
        WebElement input = findAndWait(By.cssSelector(GROUP_FINDER_SEARCH_TEXT));
        input.clear();
        input.sendKeys(user);
        WebElement searchButton = findAndWait(By.cssSelector(GROUP_SEARCH_BUTTON));
        searchButton.click();
        if (searchButton.isEnabled()) {
            searchButton.click();
        }
        return getCurrentPage();
    } catch (TimeoutException e) {
    }
    throw new PageException("Not able to perform Group Search.");
}

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

License:Open Source License

/**
 * Completes the search form on the people
 * finders page.//from w w w  .  j  av  a  2  s .  co  m
 * 
 * @param person String name
 * @return PeopleFinderPage page response
 */
public HtmlPage searchFor(final String person) {
    WebElement input = findAndWait(SEACH_INPUT);
    input.clear();
    input.sendKeys(person);
    WebElement button = findAndWait(SEARCH_BUTTON);
    button.click();
    return getCurrentPage();
}

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

License:Open Source License

/**
 * Clear the input before completing the search form on the people
 * finders page./*w w w  .j  a  v a2 s  .c  o  m*/
 * 
 * @param person String name
 * @return HtmlPage
 */
public HtmlPage clearAndSearchFor(final String person) {
    try {

        WebElement input = findAndWait(SEACH_INPUT);
        input.clear();
        input.sendKeys(person);
        WebElement button = findAndWait(SEARCH_BUTTON);
        button.click();
        return getCurrentPage().render();
    } catch (TimeoutException te) {
        throw new ShareException("Unable to retrieve control.", te);
    }
}

From source file:org.alfresco.po.share.search.AdvanceSearchCRMPage.java

License:Open Source License

/**
 * Enter the text value in the CrmAccountIdentifier field.
 * /*from w w w.  j  ava2  s . co m*/
 * @param accountIdentifier String
 */
public void inputCrmAccountId(final String accountIdentifier) {
    if (accountIdentifier == null || accountIdentifier.isEmpty()) {
        throw new UnsupportedOperationException("Search term is required to perform a search");
    }
    WebElement nameElement = findElementDisplayed(CRM_ACCOUNT_IDENTIFIER);
    nameElement.clear();
    nameElement.sendKeys(accountIdentifier);
}

From source file:org.alfresco.po.share.search.AdvanceSearchCRMPage.java

License:Open Source License

/**
 * Enter the text value in the CrmAccountName field.
 * /*  ww  w. j ava 2s  . c  om*/
 * @param accountName String
 */
public void inputCrmAccountName(final String accountName) {
    if (accountName == null || accountName.isEmpty()) {
        throw new UnsupportedOperationException("Search term is required to perform a search");
    }
    WebElement nameElement = findElementDisplayed(CRM_ACCOUNT_NAME);
    nameElement.clear();
    nameElement.sendKeys(accountName);
}

From source file:org.alfresco.po.share.search.AdvanceSearchCRMPage.java

License:Open Source License

/**
 * Enter the text value in the CrmOpportunityName field.
 * /* ww  w.  jav a  2  s .c om*/
 * @param opporName String
 */
public void inputCrmOpporName(final String opporName) {
    if (opporName == null || opporName.isEmpty()) {
        throw new UnsupportedOperationException("Search term is required to perform a search");
    }
    WebElement nameElement = findElementDisplayed(CRM_OPPOR_NAME);
    nameElement.clear();
    nameElement.sendKeys(opporName);
}

From source file:org.alfresco.po.share.search.AdvanceSearchCRMPage.java

License:Open Source License

/**
 * Enter the text value in the CrmContractNumber field.
 * //  w ww  .  j  a  v a  2s.co  m
 * @param contractNumber String
 */
public void inputCrmContractNumber(final String contractNumber) {
    if (contractNumber == null || contractNumber.isEmpty()) {
        throw new UnsupportedOperationException("Search term is required to perform a search");
    }
    WebElement nameElement = findElementDisplayed(CRM_CONTRACT_NUMBER);
    nameElement.clear();
    nameElement.sendKeys(contractNumber);
}

From source file:org.alfresco.po.share.search.AdvanceSearchCRMPage.java

License:Open Source License

/**
 * Enter the text value in the CrMContractName field.
 * /*w  ww. j a va 2 s. c  o  m*/
 * @param contractName String
 */
public void inputCrmContractName(final String contractName) {
    if (contractName == null || contractName.isEmpty()) {
        throw new UnsupportedOperationException("Search term is required to perform a search");
    }
    WebElement nameElement = findElementDisplayed(CRM_CONTRACT_NAME);
    nameElement.clear();
    nameElement.sendKeys(contractName);
}