I am trying to test a dynamic web table using protractor and trying to find the count of headers, rows and cols but always getting 0 as the count var x = element.all(by.xpath('//table//thead//tr//th'))
x.count().then(function(c){
console.log(c);
});
I tried using element.all(by.css ) as well and it returns the same , can anyone help? I used selenium and able to retrieve the value, so xpath is not wrong, but I have to use protractor to fetch the same. Selenium script which is working List col = driver.findElements(By.xpath("//div[@class='table-wrapper']//table//thead//tr/th")); System.out.println(col.size());