I'm trying to create an array with values from a TD, through findelement, but I'm not able to get the result. Could anyone help me to resolve this? Thank you very much in advance
const myvar = new Array();
await driver
.findElements(By.xpath('//table[@id="detail"]/tbody/tr'))
.then((rows) => {
for (var i = 0; i < rows.length; i++) {
rows[i]
.findElement(By.tagName('td'))
.getAttribute('innerHTML')
.then((txt) => {
myvar.push(txt);
});
}
});
for (var x = 0; x < myvar.length; x++) {
console.log(myvar[x]);
}