Example usage for org.openqa.selenium By name

List of usage examples for org.openqa.selenium By name

Introduction

In this page you can find the example usage for org.openqa.selenium By name.

Prototype

public static By name(String name) 

Source Link

Usage

From source file:com.nexenta.qa.bs.wz.Test1Reg.java

@BeforeClass
public void setUPbro() throws MalformedURLException {
    //Get Props/*from  www  . ja  v a2s  .com*/
    Properties prop = new Properties();
    reg = new RegPanel();
    InputStream input = null;
    try {
        input = new FileInputStream(System.getProperty("propFile"));
        prop.load(input);
    } catch (IOException ex) {
        ex.printStackTrace();
    } finally {
        if (input != null) {
            try {
                input.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }

    // create driver
    driver = new RemoteWebDriver(new URL("http://" + prop.getProperty("WCM") + ":4444/wd/hub"),
            DesiredCapabilities.firefox());

    driver.get("http://" + prop.getProperty("MUT") + ":8457/register/");
    String needlogin = driver.getTitle();
    logger.info(needlogin);
    if (needlogin.equals("NMV Login")) {
        WebElement nameu = driver.findElement(By.name("_nmv_username_"));
        WebElement passu = driver.findElement(By.name("_nmv_password_"));
        nameu.sendKeys("admin");
        passu.sendKeys("nexenta");
        driver.findElement(By.name("_nmv_login_")).click();
        driver.manage().timeouts().implicitlyWait(2, TimeUnit.SECONDS);
    }

}

From source file:com.nosoftskills.travianbot.page.Login.java

License:Apache License

public void login(String userName, String password) {
    WebElement userNameElement = webDriver.findElement(By.name("name"));
    userNameElement.sendKeys(userName);/* ww  w .  j  av  a2 s  . c om*/
    WebElement passwordElement = webDriver.findElement(By.name("password"));
    passwordElement.sendKeys(password);
    passwordElement.submit();

}

From source file:com.nowsprinting.hellotesting.appiumtest.appium.page.PreviewPage.java

License:Apache License

/**
 * ????????????
 */
public String getName() {
    ensureWebViewContext();
    return mDriver.findElement(By.name("name")).getText();
}

From source file:com.nowsprinting.hellotesting.appiumtest.appium.page.PreviewPage.java

License:Apache License

/**
 * ?????????
 */
public String getMailAddress() {
    ensureWebViewContext();
    return mDriver.findElement(By.name("mail")).getText();
}

From source file:com.nowsprinting.hellotesting.appiumtest.appium.page.PreviewPage.java

License:Apache License

/**
 * ?????????
 */
public String getGender() {
    ensureWebViewContext();
    return mDriver.findElement(By.name("gender")).getText();
}

From source file:com.nowsprinting.hellotesting.appiumtest.appium.page.PreviewPage.java

License:Apache License

/**
 * ?????????
 */
public String getAge() {
    ensureWebViewContext();
    return mDriver.findElement(By.name("age")).getText();
}

From source file:com.nowsprinting.hellotesting.appiumtest.appium.page.PreviewPage.java

License:Apache License

/**
 * ?????????
 */
public String getDivision() {
    ensureWebViewContext();
    return mDriver.findElement(By.name("division")).getText();
}

From source file:com.nowsprinting.hellotesting.appiumtest.selendroid.page.SelendroidDetailPage.java

License:Apache License

@Override
public boolean waitUntilLoad() {
    // ???????????
    try {/* w  w  w . ja  v a  2 s. c o  m*/
        mWait.until(ExpectedConditions.visibilityOfElementLocated(By.name("name textfield")));
    } catch (TimeoutException e) {
        return false;
    }
    return true;
}

From source file:com.nowsprinting.hellotesting.appiumtest.selendroid.page.SelendroidDetailPage.java

License:Apache License

@Override
public DetailPage inputName(String name) {
    if (name != null) {
        WebElement nameTextField = mDriver.findElement(By.name("name textfield"));
        nameTextField.sendKeys(name);/*  w  w  w  .  j ava2s.co  m*/
    }
    return this;
}

From source file:com.nowsprinting.hellotesting.appiumtest.selendroid.page.SelendroidDetailPage.java

License:Apache License

@Override
public DetailPage inputMailAddress(String mailAddress) {
    if (mailAddress != null) {
        WebElement mailTextField = mDriver.findElement(By.name("mail textfield"));
        mailTextField.sendKeys(mailAddress);

    }/*  w  w  w.java  2  s .  com*/
    return this;
}