Example usage for org.openqa.selenium WebElement click

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

Introduction

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

Prototype

void click();

Source Link

Document

Click this element.

Usage

From source file:cls.ui.model.selenium.carDealerManage.BasicInfoPage.java

public void clickAddAccountButton() throws Throwable {
    WebElement addAccountBtn = driver.findElement(By.xpath(
            "/html/body/div/div[1]/div[1]/div[2]/div[1]/div/div/div/form/fieldset/div[3]/div/div[1]/div[2]/ul/li/a"));
    addAccountBtn.click();
    Thread.sleep(2000);//from  ww  w . j  a v  a 2 s  .co  m
}

From source file:cls.ui.model.selenium.carDealerManage.BasicInfoPage.java

public void clickAddDialogSaveButton() throws Throwable {
    WebElement saveBtn = driver
            .findElement(By.xpath("/html/body/div[1]/div[1]/div[2]/div/div/form/div[2]/button[1]"));
    saveBtn.click();
}

From source file:cls.ui.model.selenium.carDealerManage.BasicInfoPage.java

public void clickAddDialogCancelButton() throws Throwable {
    WebElement cancelBtn = driver
            .findElement(By.xpath("/html/body/div[1]/div[1]/div[2]/div/div/form/div[2]/button[1]"));
    cancelBtn.click();
}

From source file:cls.ui.model.selenium.carDealerManage.BasicInfoPage.java

public void clickSubmitButton() throws Throwable {
    WebElement submitBtn = driver
            .findElement(By.xpath("/html/body/div/div[1]/div[1]/div[3]/div/div/div/div/span/button[1]"));
    submitBtn.click();
}

From source file:cls.ui.model.selenium.carDealerManage.BasicInfoPage.java

public void clickConfirmYesButton() throws Throwable {
    WebElement confirmBtn = driver
            .findElement(By.xpath("/html/body/div[1]/div[1]/div[5]/div/div/div[3]/button[1]"));
    confirmBtn.click();
}

From source file:cls.ui.model.selenium.carDealerManage.BasicInfoPage.java

public void clickConfirmNoButton() throws Throwable {
    WebElement cancelBtn = driver
            .findElement(By.xpath("/html/body/div[1]/div[1]/div[5]/div/div/div[3]/button[2]"));
    cancelBtn.click();
}

From source file:cls.ui.model.selenium.secondhandcarmanagement.StartAssessmentPage.java

public void selectBrand(String letter, String brand) throws Throwable {
    WebElement brandInput = driver.findElement(By.id("getBrand"));
    brandInput.click();

    List<WebElement> letterLst = driver.findElements(By.xpath(
            "/html/body/div/div/div/div/div/div[2]/div[1]/div/div[1]/div/div/form/div[2]/div[2]/div[2]/div[1]/div/ul/div[2]/a"));
    for (int i = 0; i < letterLst.size(); i++) {
        WebElement letterBtn = letterLst.get(i);
        if (letterBtn.getText().equals(letter)) {
            letterBtn.click();//from   ww w.  ja v  a2  s  .c  o  m
            break;
        }
    }

    List<WebElement> brandLst = driver.findElements(By.xpath(
            "/html/body/div[1]/div/div/div/div/div[2]/div[1]/div/div[1]/div/div/form/div[2]/div[2]/div[2]/div[1]/div/ul/div[1]/li"));
    for (int i = 0; i < brandLst.size(); i++) {
        WebElement brandBtn = brandLst.get(i);
        if (brandBtn.getText().equals(brand)) {
            brandBtn.click();
            break;
        }
    }

    Thread.sleep(1000);
}

From source file:cls.ui.model.selenium.secondhandcarmanagement.StartAssessmentPage.java

public void enterLicenseDate(String licenseDate) {
    WebElement licenseDateInput = driver.findElement(By.name("licenseDate"));
    licenseDateInput.clear();//from   w ww .  jav  a  2 s.  c o  m
    licenseDateInput.sendKeys(licenseDate);
    licenseDateInput.click();
}

From source file:cls.ui.model.selenium.secondhandcarmanagement.StartAssessmentPage.java

public void enterCommercialInsuranceDate(String commercialInsuranceDate) {
    WebElement commercialInsuranceDateInput = driver.findElement(By.name("commercialInsuranceExpiredDate"));
    commercialInsuranceDateInput.clear();
    commercialInsuranceDateInput.sendKeys(commercialInsuranceDate);
    commercialInsuranceDateInput.click();
}

From source file:cls.ui.model.selenium.secondhandcarmanagement.StartAssessmentPage.java

public void enterCompulsoryInsuranceDate(String compulsoryInsuranceDate) {
    WebElement compulsoryInsuranceDateInput = driver
            .findElement(By.name("trafficCompulsoryInsuranceExpiredDate"));
    compulsoryInsuranceDateInput.clear();
    compulsoryInsuranceDateInput.sendKeys(compulsoryInsuranceDate);
    compulsoryInsuranceDateInput.click();
}