When we comparing rows of tables and excels, we can´t compare the lines that are not visible. The line that is not visible by Katalon, is index as 13.
How can I solve this problem?
The following error that generates on Katalon is:
FAILED because (of) java.lang.IndexOutOfBoundsException: Index: 13, Size: 13
The code that we used to go through the whole table is:
WebDriver driver = DriverFactory.getWebDriver()
WebElement Table = driver.findElement(By.xpath(‘//*[@id = \‘gridLineas\’]/tbody’))
ExcelData exceldata = findTestData(‘DatosLineas’)
List rows_table = Table.findElements(By.tagName(‘tr’))
KeywordLogger log = new KeywordLogger()
log.logInfo("rows: " + exceldata.getRowNumbers() + " cols: " + exceldata.getColumnNumbers())
for (def fila : (1…exceldata.getRowNumbers())) {
for (def columna : (1..exceldata.getColumnNumbers())) {
List Cols = rows_table.get(fila - 1).findElements(By.tagName(‘td’))
if(columna != 6)
{
log.logInfo(exceldata.getObjectValue(columna, fila))
log.logInfo(Cols.get(columna - 1).getText())
assert exceldata.getObjectValue(columna, fila) == Cols.get(columna - 1).getText()
}
else
{
log.logInfo(Cols.get(columna - 1).getText())
String texto = Cols.get(columna - 1).getText()
log.logInfo("tamaño total: " + texto.length())
for(def letra : (0…texto.length()-1))
{
log.logInfo(texto.charAt(letra).getNumericValue(texto.charAt(letra)).toString())
}
}
}
}