Comparing Tables and Excels

When I´m comparing tables and Excel I´ve had an error on Log Viewer. Could anybody help me? The script 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’))

for (def fila : (1…exceldata.getRowNumbers())) {

for (def columna : (1..exceldata.getColumnNumbers())) {

    List<WebElement> Cols = rows_table.get(fila - 1).findElements(By.tagName('td'))



    assert exceldata.getObjectValue(columna, fila) == Cols.get(columna - 1).getText()

}

}

And the error is:

05-07-2018 01:31:28 PM - [FAILED] - Test Cases/Procesos/AperturaProceso_2_5_AnadirLineaDesdeExcel FAILED because (of) org.codehaus.groovy.runtime.powerassert.PowerAssertionError: assert exceldata.getObjectValue(columna, fila) == Cols.get(columna - 1).getText()

   |         |              |        |     |  |    |   |       |    |

   |         12             5        1     |  |    |   5       4    12,00

   |                                       |  |    \[\[\[\[\[\[CChromeDriver: chrome on XP (d3b1ade9055201decc3063be6100d86b)\] -> xpath: //*\[@id = 'gridLineas'\]/tbody\]\] -> tag name: tr\]\] -> tag name: td\]

   |                                       |  \[\[\[\[\[\[\[CChromeDriver: chrome on XP (d3b1ade9055201decc3063be6100d86b)\] -> xpath: //*\[@id = 'gridLineas'\]/tbody\]\] -> tag name: tr\]\] -> tag name: td\], \[\[\[\[\[\[CChromeDriver: chrome on XP (d3b1ade9055201decc3063be6100d86b)\] -> xpath: //*\[@id = 'gridLineas'\]/tbody\]\] -> tag name: tr\]\] -> tag name: td\], \[\[\[\[\[\[CChromeDriver: chrome on XP (d3b1ade9055201decc3063be6100d86b)\] -> xpath: //*\[@id = 'gridLineas'\]/tbody\]\] -> tag name: tr\]\] -> tag name: td\], \[\[\[\[\[\[CChromeDriver: chrome on XP (d3b1ade9055201decc3063be6100d86b)\] -> xpath: //*\[@id = 'gridLineas'\]/tbody\]\] -> tag name: tr\]\] -> tag name: td\], \[\[\[\[\[\[CChromeDriver: chrome on XP (d3b1ade9055201decc3063be6100d86b)\] -> xpath: //*\[@id = 'gridLineas'\]/tbody\]\] -> tag name: tr\]\] -> tag name: td\], \[\[\[\[\[\[CChromeDriver: chrome on XP (d3b1ade9055201decc3063be6100d86b)\] -> xpath: //*\[@id = 'gridLineas'\]/tbody\]\] -> tag name: tr\]\] -> tag name: td\], \[\[\[\[\[\[CChromeDriver: chrome on XP (d3b1ade9055201decc3063be6100d86b)\] -> xpath: //*\[@id = 'gridLineas'\]/tbody\]\] -> tag name: tr\]\] -> tag name: td\], \[\[\[\[\[\[CChromeDriver: chrome on XP (d3b1ade9055201decc3063be6100d86b)\] -> xpath: //*\[@id = 'gridLineas'\]/tbody\]\] -> tag name: tr\]\] -> tag name: td\]\]

   |                                       false

   com.kms.katalon.core.testdata.reader.SheetPOI@252f626c

The following message is saying: ‘12’ is not equal to ‘12,00’. It is right. No reason why you should get surprised.

assert exceldata.getObjectValue(columna, fila) == Cols.get(columna - 1).getText()
       |         |              |        |     |  |    |   |       |    |
       |         12             5        1     |  |    |   5       4    12,00

The problem is that there were more than twelve lines. That is, you only see those lines that have not been scrolled. And we need to scroll through all the lines of the viewer…