I need to compare the 2 columns in the excel using the selenium java but excel contains more than 4k records so its taking more than a hour to compare. Is there any faster way of doing this.
I tried, Method 1
println(GlobalVariable.gl_system_time)
for(int k=2;k<= sheet.getLastRowNum();k++)
{
formulary1 = sheet.getRow(k).getCell(2).getStringCellValue()
columnName.add(formulary1)
formulary2 = sheet.getRow(k).getCell(3).getStringCellValue()
columnName1.add(formulary2)
}
println(GlobalVariable.gl_system_time)
if(columnName1.equals(columnName))
{
KeywordUtil.markFailed('column are same')
}
else
{
KeywordUtil.markPassed('column are different as expected')
}
println(columnName)
println(columnName1)
Method 2
for(int k=2;k<= sheet.getLastRowNum();k++)
{
formulary1 = sheet.getRow(k).getCell(2).getStringCellValue()
formulary2 = sheet.getRow(k).getCell(3).getStringCellValue()
if(formulary1 == formulary2)
{
break ;
}
else{
continue;
}
}
but both are taking more than a hour.
Thanks.