nitinn
8 years agoOccasional Contributor
Need help in counting the total no. of elements in a table
Hi,
I am trying to count the no. of elements present in a table and if they are present, I need to click on them.
Suppose 3 elements are present, I need to click on each one of them.
Below is my code:
function findata()
{
//if (page.FindChildByXPath("//table[contains(@id,'repeaterTable')]//tr//td/a[@class = 'textlink hand']")
let arr = page.EvaluateXPath("//table[contains(@id,'repeaterTable')]//tr//td/a[@class = 'textlink hand']");
if (!strictEqual(arr,null))
{
for (i in arr)
{arr[i].Click();
page.FindChildByXPath("//input[contains(@id,'buttonListReturn')]").Click();
Delay(2000)
i++;
}
}
else
{
Log.Error("Nothing found");
}
}