This Piece of Java Code works well in Selenium. I would like to try now in Katalon - Groovy. Could you please guide me on this. Thanks in advance.
Selenium Java Code:
WebElement ele1, ele2;
ele1 = driver.findElement(By.id(“main”));
List<WebElement> ls = ele1.findElements(By.xpath("/html/body/section/table"));
for(int k=0;k<ls.size();k++)
{
WebElement we = ls.get(k);
List<WebElement> ls1 = we.findElements(By.tagName("td"));
for(int l=0;l<ls1.size();l++)
{
WebElement we1 = ls1.get(l);
if (cellVal\[4\].equals("Local"))
{
if(we1.getText().contains(cellVal\[5\])) // to compare the value with Excel cell value.
{
ele2 = we1.findElement(By.xpath("following::a")); // to click on the hyperlink 'Click' of corresponding record matched above.
ele2.click();
break;
}
}
else
if (cellVal\[4\].equals("Global"))
{
if(we1.getText().contains("Manager"))
{
ele2 = we1.findElement(By.xpath("following::a"));
ele2.click();
break;
}
}
}
}