Example usage for org.openqa.selenium By cssSelector

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

Introduction

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

Prototype

public static By cssSelector(String cssSelector) 

Source Link

Document

Find elements via the driver's underlying W3C Selector engine.

Usage

From source file:co.edu.uniandes.csw.stamps.tests.selenium.pages.stamp.StampListPage.java

License:Open Source License

public Integer countStamps() {
    return browser.findElements(By.cssSelector("tbody > tr")).size();
}

From source file:co.edu.uniandes.csw.stamps.tests.selenium.pages.tShirt.TShirtListPage.java

License:Open Source License

public Integer countTShirts() {
    return browser.findElements(By.cssSelector("tbody > tr")).size();
}

From source file:co.edu.uniandes.csw.turism.tests.selenium.pages.agency.AgencyListPage.java

License:Open Source License

public Integer countAgencys() {
    return browser.findElements(By.cssSelector("tbody > tr")).size();
}

From source file:co.edu.uniandes.csw.turism.tests.selenium.pages.comment.CommentListPage.java

public Integer countTrips() {
    return browser.findElements(By.cssSelector("tbody > tr")).size();
}

From source file:co.edu.uniandes.csw.turism.tests.selenium.pages.content.ContentListPage.java

License:Open Source License

public Integer countContents() {
    return browser.findElements(By.cssSelector("tbody > tr")).size();
}

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

License:Open Source License

public Integer countDestinations() {
    return browser.findElements(By.cssSelector("tbody > tr")).size();
}

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

License:Open Source License

public Integer countQuestions() {
    return browser.findElements(By.cssSelector("tbody > tr")).size();
}

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

public InstanceNewPage instanceCreationWizardScreen2(String cloud, String[] additionalSW) { //added wait statement to check object is avaialable to click
    driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

    try {//from   w  w w .j a  v  a2  s  .c  o  m
        String x = "//input[@name='" + cloud + "']";
        if (driver.findElement(By.xpath(x)).isSelected() != true) {
            driver.findElement(By.xpath(x)).click();
        }
        // Choose additional software to provision.
        System.out.println("addition settings=" + additionalSW.length);
        for (int i = 0; i < additionalSW.length; i++) {
            String z = "input[name='" + additionalSW[i] + "']";
            if (driver.findElement(By.cssSelector(z)).isSelected() != true) {
                driver.findElement(By.cssSelector(z)).click();
            }
        }
        clickWizardButton("Wizard 2: ", "Next");
    } catch (NoSuchElementException | StaleElementReferenceException e) {
        System.out.println("Trying to recover from a NoSuchElementException :-");

    }
    return new InstanceNewPage(driver);
}

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

public InstanceNewPage instanceCreationWizardScreen2_1(String[] hadoopDistribution) {
    driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
    System.out.println("addition settings=" + hadoopDistribution.length);
    int count = 0;

    try {//ww w  . jav a  2  s .  com
        for (int i = 0; i < hadoopDistribution.length; i++) {
            String z = "input[name='" + hadoopDistribution[i] + "']";
            if (driver.findElement(By.cssSelector(z)).isSelected() != true) {
                driver.findElement(By.cssSelector(z)).click();

                if (hadoopDistribution[i].equals("DataFlow")) {
                    if (System.getProperty("os.name").contains("Windows")) {
                        licensepath = "D:\\Actian\\selenium\\amcAuto\\src\\main\\resources\\drivers\\DataFlow_Unlimited_Internal_20161231.slc";
                        driver.findElement(licensebrowserbutton).sendKeys(licensepath);
                    } else {
                        licensepath = "/root/scripts_copy/license/DataFlow_Unlimited_Internal_20161231.slc";
                        driver.findElement(licensebrowserbutton).sendKeys(licensepath);
                    }
                }
            }
        }
    } catch (NoSuchElementException | StaleElementReferenceException e) {
        System.out.println("Trying to recover from a NoSuchElementException :-");

    }
    return new InstanceNewPage(driver);
}

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

public InstanceNewPage instanceCreationWizardScreen2_2(String ambariVersion, String HDPversion) {
    driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
    System.out.println("hadoopDistribution version :=" + ambariVersion);
    System.out.println("HDPverssion :" + HDPversion);
    int count = 0;

    try {//from w w  w  . j a  v  a 2s  . c o m
        String z = "input[name='" + ambariVersion + "']";
        if (driver.findElement(By.cssSelector(z)).isSelected() != true) {
            driver.findElement(By.cssSelector(z)).click();
        }
        By dropdown = By.xpath("//input[@name='" + ambariVersion + "']/following::div[4]/div[1]/div[1]");
        driver.findElement(dropdown).click();
        List<WebElement> versions = driver.findElements(itemsInDropdown);
        {
            for (int i = 0; i < versions.size(); i++) {
                if (versions.get(i).getText().equals(HDPversion)) {
                    versions.get(i).click();
                    break;
                }
            }
        } //screenShot(driver);// added to verify ambari versions selection
    } catch (NoSuchElementException | StaleElementReferenceException e) {
        System.out.println("Trying to recover from a NoSuchElementException 2.2:-");

    }
    return new InstanceNewPage(driver);
}