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:co.edu.uniandes.csw.turism.tests.selenium.pages.content.ContentListPage.java

License:Open Source License

public void viewContentDetails(Integer index) {
    WebElement detailsButton = findDetailsBtnByIndex(index);
    detailsButton.click();
}

From source file:co.edu.uniandes.csw.turism.tests.selenium.pages.destination.DestinationListPage.java

License:Open Source License

public void editDestination(Integer index) {
    WebElement editButton = findEditBtnByIndex(index);
    editButton.click();
}

From source file:co.edu.uniandes.csw.turism.tests.selenium.pages.destination.DestinationListPage.java

License:Open Source License

public void deleteDestination(Integer index) {
    WebElement deleteButton = findDeleteBtnByIndex(index);
    deleteButton.click();
}

From source file:co.edu.uniandes.csw.turism.tests.selenium.pages.destination.DestinationListPage.java

License:Open Source License

public void viewDestinationDetails(Integer index) {
    WebElement detailsButton = findDetailsBtnByIndex(index);
    detailsButton.click();
}

From source file:co.edu.uniandes.csw.turism.tests.selenium.pages.question.QuestionListPage.java

License:Open Source License

public void editQuestion(Integer index) {
    WebElement editButton = findEditBtnByIndex(index);
    editButton.click();
}

From source file:co.edu.uniandes.csw.turism.tests.selenium.pages.question.QuestionListPage.java

License:Open Source License

public void deleteQuestion(Integer index) {
    WebElement deleteButton = findDeleteBtnByIndex(index);
    deleteButton.click();
}

From source file:co.edu.uniandes.csw.turism.tests.selenium.pages.question.QuestionListPage.java

License:Open Source License

public void viewQuestionDetails(Integer index) {
    WebElement detailsButton = findDetailsBtnByIndex(index);
    detailsButton.click();
}

From source file:com.actian.amc.pages.InstanceNewPage.java

public InstanceNewPage selectPlatformProduct(String actianProduct) {
    driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
    int count = 0;

    try {/*from   w w w  .jav  a 2 s  . co m*/
        driver.findElement(platformProductDropDown).click();
        List<WebElement> products = driver.findElements(itemsInDropdown);
        boolean foundProduct = false;
        for (WebElement product : products) {
            System.out.println(product.getText());
            if (product.getText().contains(actianProduct)) {
                product.click();
                try {
                    Thread.sleep(2000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                foundProduct = true;
                break;
            }
        }
        if (foundProduct != true) {
            System.out.println("Product is not Select OR Not a valid product:" + actianProduct);
        }

    } catch (StaleElementReferenceException e) {
        System.out.println("Trying to recover from a StaleElementReferenceException :-");

    }
    return new InstanceNewPage(driver);
}

From source file:com.actian.amc.pages.NewCloudDefinitionPage.java

public String clickNewCloudDefButton(String btn) {
    driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

    try {/*w ww.  j av a  2s  .  co m*/
        driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
        List<WebElement> cloudBtns = driver.findElements(buttonNames);
        for (WebElement button : cloudBtns)
            if (button.getText().contains(btn)) {
                String sButton = button.getText();
                if (sButton.contains("Cancel")) {
                    button.click();
                    try {
                        Thread.sleep(5000);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                    return "";
                } else if (sButton.contains("Create") | sButton.contains("Test Cloud")) {
                    try {
                        Thread.sleep(5000);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                    button.click();
                    return this.getCreationTestStatus();
                } else {
                    System.out.println("Not a valid button: " + btn);
                    return "";
                }
            }
    } catch (NoSuchElementException | StaleElementReferenceException e) {
        System.out.println("Trying to recover from a stale element :-");
    }
    return "";
}

From source file:com.actian.amc.pages.NewCloudDefinitionPage.java

public NewCloudDefinitionPage selectAWSRegion(String region) {
    driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
    int count = 0;
    try {/*from   w  ww .j ava 2  s  .c o  m*/
        driver.findElement(dropdown_Region).click();
        List<WebElement> cloudProviders = driver.findElements(itemsInDropdown);
        for (WebElement cloud : cloudProviders) {
            System.out.println("Cloud Zone Name : " + cloud.getText());
            if (cloud.getText().equalsIgnoreCase(region)) {
                cloud.click();
                break;
            }
        }
    } catch (NoSuchElementException | StaleElementReferenceException | IndexOutOfBoundsException e) {
        System.out.println("Trying to recover from a stale element :-");
    }
    return new NewCloudDefinitionPage(driver);
}