RE: Not able get the total number of rows from the given code from a dynamic webtable

public class TestWebtable {

    public static void main(String[] args) {
        WebDriver driver = new FirefoxDriver();
        driver.get("http://www.espncricinfo.com/indian-premier-league-2016/engine/match/981019.html");

        int i = 2;
        int rowNum = 0;
        while (driver
                .findElement(
                        By.xpath(".//*[@id='full-scorecard']/div[2]/div/table[1]/tbody/tr["
                                + i + "]/td[2]/a")).isDisplayed()) {

            i = i + 2;
            rowNum++;

        }
        System.out.println("Total rows are : " + rowNum);

}}
Akash123 Default Asked on October 14, 2016 in Selenium WebDriver.
Add Comment
1 Answers

public class TestWebtable {

}}

Default Answered on October 19, 2016.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.