Hi ITeam ,
I am passing the a parameter via a driver instance , but its not takeing the values .
List rows = driver.findElements(By.xpath("//*[@id=‘ViewGrid_grdView’]/tbody/tr"))
println rows.size();
List cols = driver.findElements(By.xpath("//*[@id=‘ViewGrid_grdView’]/tbody/tr[1]/td"))
println cols.size();
try{
for (int i = 2; i <= rows.size(); i++) {
WebElement Ele =driver.findElement(By.xpath("//*[@id=‘ViewGrid_grdView’]/tbody/tr[1]/td["+i+"]"));
String colname = Ele.getText().toString();
if (colname == ‘TIN’ || colname == ‘PassportNo’ || colname == ‘LicenseNo’) {
for (int j = 2; j <= cols.size(); j++) {
def Cellval = driver.findElement(By.xpath("//*[@id=‘ViewGrid_grdView’]/tbody/tr[$i]/td[$j]")).getText().toString().trim()
println(Cellval)
}
}
}
Katalon is not accepting the “i” values when i pass the paramter through drvier instance elements .But when i parametrize in the Object repository i am able to access the element.
kindly do the need full.