Example usage for org.openqa.selenium WebElement sendKeys

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

Introduction

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

Prototype

void sendKeys(CharSequence... keysToSend);

Source Link

Document

Use this method to simulate typing into an element, which may set its value.

Usage

From source file:com.ecofactor.qa.automation.insite.page.UserManagementImpl.java

License:Open Source License

/**
 * Edits the last name./*from w  w w  . j a  v  a 2  s .  c  o  m*/
 * @param lastName the last name
 * @see com.ecofactor.qa.automation.insite.page.UserManagement#editLastName(java.lang.String)
 */
@Override
public void editLastName(final String lastName) {

    DriverConfig.setLogString("Edit Last Name", true);
    if (lastName != null && !lastName.isEmpty()) {
        final WebElement firstNameElemt = DriverConfig.getDriver()
                .findElement(By.id(userConfig.get(LAST_NAME)));
        firstNameElemt.clear();
        DriverConfig.setLogString("Enter LastName: " + lastName, true);
        firstNameElemt.sendKeys(lastName);
    }
}

From source file:com.ecofactor.qa.automation.insite.page.UserManagementImpl.java

License:Open Source License

/**
 * Edits the email id./*w w w .j  a  v a2 s  . c  om*/
 * @param emailId the email id
 * @see com.ecofactor.qa.automation.insite.page.UserManagement#editEmailId(java.lang.String)
 */
@Override
public void editEmailId(final String emailId) {

    DriverConfig.setLogString("Edit emailId", true);
    if (emailId != null && !emailId.isEmpty()) {
        final WebElement emailElemt = DriverConfig.getDriver().findElement(By.id(userConfig.get(EMAIL_FIELD)));
        emailElemt.clear();
        DriverConfig.setLogString("Enter Email Address: " + emailId, true);
        emailElemt.sendKeys(emailId);
    }
}

From source file:com.ecofactor.qa.automation.insite.page.UserManagementImpl.java

License:Open Source License

/**
 * Edits the street address1.//from   ww  w . ja  v a 2  s .c o  m
 * @param streetAddress the street address
 * @see com.ecofactor.qa.automation.insite.page.UserManagement#editStreetAddress1(java.lang.String)
 */
@Override
public void editStreetAddress1(final String streetAddress) {

    DriverConfig.setLogString("Edit streetAddress", true);
    if (streetAddress != null && !streetAddress.isEmpty()) {
        final WebElement emailElemt = DriverConfig.getDriver()
                .findElement(By.id(userConfig.get(STREET_ADDRESS1)));
        emailElemt.clear();
        DriverConfig.setLogString("Enter streetAddress: " + streetAddress, true);
        emailElemt.sendKeys(streetAddress);
    }
}

From source file:com.ecofactor.qa.automation.insite.page.UserManagementImpl.java

License:Open Source License

/**
 * Edits the street address2./*from www  . ja va2  s  .  co m*/
 * @param streetAddress the street address
 * @see com.ecofactor.qa.automation.insite.page.UserManagement#editStreetAddress2(java.lang.String)
 */
@Override
public void editStreetAddress2(String streetAddress) {

    DriverConfig.setLogString("Edit streetAddress", true);
    if (streetAddress != null && !streetAddress.isEmpty()) {
        final WebElement emailElemt = DriverConfig.getDriver()
                .findElement(By.id(userConfig.get(STREET_ADDRESS2)));
        emailElemt.clear();
        DriverConfig.setLogString("Enter streetAddress: " + streetAddress, true);
        emailElemt.sendKeys(streetAddress);
    }
}

From source file:com.ecofactor.qa.automation.insite.page.UserManagementImpl.java

License:Open Source License

/**
 * Edits the city.//  w ww  . j  a va 2s . c  o m
 * @param city the city
 * @see com.ecofactor.qa.automation.insite.page.UserManagement#editCity(java.lang.String)
 */
@Override
public void editCity(final String city) {

    DriverConfig.setLogString("Edit city", true);
    if (city != null && !city.isEmpty()) {
        final WebElement emailElemt = DriverConfig.getDriver().findElement(By.id(userConfig.get(CITY)));
        emailElemt.clear();
        DriverConfig.setLogString("Enter city: " + city, true);
        emailElemt.sendKeys(city);
    }
}

From source file:com.ecofactor.qa.automation.insite.page.UserManagementImpl.java

License:Open Source License

/**
 * Edits the state.//from  w ww.j av  a 2  s  . c om
 * @param state the state
 * @see com.ecofactor.qa.automation.insite.page.UserManagement#editState(java.lang.String)
 */
@Override
public void editState(final String state) {

    DriverConfig.setLogString("Edit state", true);
    if (state != null && !state.isEmpty()) {
        final WebElement emailElemt = DriverConfig.getDriver().findElement(By.id(userConfig.get(STATE)));
        emailElemt.clear();
        DriverConfig.setLogString("Enter state: " + state, true);
        emailElemt.sendKeys(state);
    }
}

From source file:com.ecofactor.qa.automation.insite.page.UserManagementImpl.java

License:Open Source License

/**
 * Edits the zip.//from  www. ja  v  a  2  s  .  c o  m
 * @param zip the zip
 * @see com.ecofactor.qa.automation.insite.page.UserManagement#editZip(java.lang.String)
 */
@Override
public void editZip(final String zip) {

    DriverConfig.setLogString("Edit zip", true);
    if (zip != null && !zip.isEmpty()) {
        final WebElement emailElemt = DriverConfig.getDriver().findElement(By.id(userConfig.get(ZIP)));
        emailElemt.clear();
        DriverConfig.setLogString("Enter zip: " + zip, true);
        emailElemt.sendKeys(zip);
    }
}

From source file:com.ecofactor.qa.automation.insite.page.UserManagementImpl.java

License:Open Source License

/**
 * Edits the country.//from  w  w w.  java2s  . c o  m
 * @param country the country
 * @see com.ecofactor.qa.automation.insite.page.UserManagement#editCountry(java.lang.String)
 */
@Override
public void editCountry(final String country) {

    DriverConfig.setLogString("Edit country", true);
    if (country != null && !country.isEmpty()) {
        final WebElement emailElemt = DriverConfig.getDriver().findElement(By.id(userConfig.get(COUNTRY)));
        emailElemt.clear();
        DriverConfig.setLogString("Enter country: " + country, true);
        emailElemt.sendKeys(country);
    }
}

From source file:com.ecofactor.qa.automation.insite.page.UserManagementImpl.java

License:Open Source License

/**
 * Edits the mobile phone number./*from w  w  w .j  av  a  2  s  .  co  m*/
 * @param mobilePhoneNumber the mobile phone number
 * @see com.ecofactor.qa.automation.insite.page.UserManagement#editMobilePhoneNumber(java.lang.String)
 */
@Override
public void editMobilePhoneNumber(final String mobilePhoneNumber) {

    DriverConfig.setLogString("Edit mobilePhoneNumber", true);
    if (mobilePhoneNumber != null && !mobilePhoneNumber.isEmpty()) {
        final WebElement emailElemt = DriverConfig.getDriver().findElement(By.id(userConfig.get(MOBILE_NUM)));
        emailElemt.clear();
        DriverConfig.setLogString("Enter mobilePhoneNumber: " + mobilePhoneNumber, true);
        emailElemt.sendKeys(mobilePhoneNumber);
    }
}

From source file:com.ecofactor.qa.automation.insite.page.UserManagementImpl.java

License:Open Source License

/**
 * Edits the home phone number./*from   w w w.java 2  s  .  co  m*/
 * @param homePhoneNumber the home phone number
 * @see com.ecofactor.qa.automation.insite.page.UserManagement#editHomePhoneNumber(java.lang.String)
 */
@Override
public void editHomePhoneNumber(final String homePhoneNumber) {

    DriverConfig.setLogString("Edit homePhoneNumber", true);
    if (homePhoneNumber != null && !homePhoneNumber.isEmpty()) {
        final WebElement emailElemt = DriverConfig.getDriver().findElement(By.id(userConfig.get(PHONE_NUM)));
        emailElemt.clear();
        DriverConfig.setLogString("Enter homePhoneNumber: " + homePhoneNumber, true);
        emailElemt.sendKeys(homePhoneNumber);
    }
}