I have table which contains several elements, which again contains div but the no. of div are , meaning for each td no. of div are different, I wanted to find the no. of div and iterate them dynamically to get each div values.
below is what I tried using xpath, But I’m not sure how can I get count of before starting the loop.

for(int i=1;i<=NoOfDivs;i++) {
        WebElement NestedDivs= driver.findElement(By.xpath("/html/body/table[4]/tbody/tr[3]/td[2]/div["+i+"]"));
        }

enter image description here



Source link https://sqa.stackexchange.com/questions/34950/how-to-get-count-of-dynamic-divs-nested-inside-a-each-td-

LEAVE A REPLY

Please enter your comment!
Please enter your name here