How to handle Web Tables on katalon

Hi everyone,
I’m trying to create a test case to edit the row that has the Payment day 30/06/2020 ,
i used this code “example 2” https://docs.katalon.com/katalon-studio/docs/handle_web_tables.html#example-2you-want-to-perform-actions-on-the-web-table-below
i got this error:For trouble shooting, please visit: https://docs.katalon.com/katalon-studio/docs/troubleshoot-common-execution-exceptions-web-test.html

11-27-2020 02:53:54 PM Test Cases/InterestRate/test

Elapsed time: 26.571s

Test Cases/InterestRate/test FAILED.
Reason:
org.openqa.selenium.NoSuchElementException: no such element: Unable to locate element: {“method”:“css selector”,“selector”:“a”}
(Session info: chrome=84.0.4147.89)
For documentation on this error, please visit: Exceptions | Selenium
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:25:53’
System info: host: ‘DESKTOP-450G6KJ’, ip: ‘192.168.178.72’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_181’

Here is the web table :

Code html:

my code:

WebUI.callTestCase(findTestCase('Test Cases/InterestRate/Start'), [:], FailureHandling.STOP_ON_FAILURE)

String excelFilePath = 'C:\\Users\\Fatima\\Desktop\\update.xlsx'

		String sheetName = 'Sheet1'
		int excelDatarows=60

		   workbook02 = ExcelKeywords.getWorkbook(excelFilePath)
		sheet02 = ExcelKeywords.getExcelSheet(workbook02, sheetName)

		Object excelData = ExcelFactory.getExcelDataWithDefaultSheet('update.xlsx', 'Sheet1', true)
		

//Input Loop:

for (row = 1; row <= excelDatarows; row++) {
	
	
	
	WebUI.setText(findTestObject('Object Repository//nput_Search_form-control'), 'TEST SAM ')
	
	WebUI.click(findTestObject('Object Repository/td_paydate1'))
	
	WebUI.click(findTestObject('Object Repository/img-edit'))
	
	//WebUI.click(findTestObject('Object Repository/pay-date2'))
	
	//WebUI.click(findTestObject('Object Repository/a_Edit'))
	String ExpectedValue ='30/06/2020'
	
	int OK=0
	//codition1:--------------------------
	'Expected value from Table'
	
 
	
   WebDriver driver = DriverFactory.getWebDriver()
	
   'To locate table'
	
   WebElement Table = driver.findElement(By.xpath('//*[@id="sample_1"]'))
	
   'To locate rows of table it will Capture all the rows available in the table '
	
   List<WebElement> Rows = Table.findElements(By.tagName('tr'))
	
   println('No. of rows: ' + Rows.size())
	
   'Find a matching text in a table and performing action'
	
   'Loop will execute for all the rows of the table'
	
   table: for (int i = 0; i < Rows.size(); i++) {
	
   'To locate columns(cells) of that specific row'
	
   List<WebElement> Cols = Rows.get(i).findElements(By.tagName('td'))
	
   for (int j = 4; j < Cols.size(); j++) {
	
   'Verifying the expected text in the each cell'
	
   if (Cols.get(j).getText().equalsIgnoreCase(ExpectedValue)) {
	
   'To locate anchor in the expected value matched row to perform action'
	
   Edit=Cols.get(10).findElement(By.tagName('a'))
	
	Edit.click()
   
 
   OK=1
   
   break
  
   
   
  
	
   }
	
   }
   
	
   }
   WebUI.switchToWindowIndex(1)
	
   WebUI.setText(findTestObject('Object Repository/input_SPREAD_spread'), excelData.getValue('Spread', row))
   
   WebUI.setText(findTestObject('Object Repository/input_OTHERS_others'), excelData.getValue('Other', row))
   
   
   WebUI.click(findTestObject('Object Repository/input_Comment_update'))
	
   WebUI.switchToWindowIndex(0)
	
   WebUI.click(findTestObject('Object Repository/a_Back-interest'))
	
	

	//Save Alerts:
	
	
	
		if (OK == 0)
		{
			alertText = 'Doesnt exist'
	
			
	
			String excelFilePath1 = 'C:\\Users\\Fatima\\Desktop\\update.xlsx'
	
			String sheetName1 = 'Sheet1'
	
			workbook01 = ExcelKeywords.getWorkbook(excelFilePath1)
	
			sheet01 = ExcelKeywords.getExcelSheet(workbook01, sheetName1)
	
			ExcelKeywords.setValueToCellByIndex(sheet01, row, 6, alertText)
	
			ExcelKeywords.saveWorkbook(excelFilePath1, workbook01)
	
			
		} else {
		
			alertText = 'ok'
	
			
			String excelFilePath1 = 'C:\\Users\\Fatima\\Desktop\\update.xlsx'
	
			String sheetName1 = 'Sheet1'
	
			workbook01 = ExcelKeywords.getWorkbook(excelFilePath1)
	
			sheet01 = ExcelKeywords.getExcelSheet(workbook01, sheetName1)
	
			int rowIndex = 7
	
			ExcelKeywords.setValueToCellByIndex(sheet01, row, 6, alertText)
	
			ExcelKeywords.saveWorkbook(excelFilePath1, workbook01)
		}
	
		Thread.sleep(3000)
	}

the test always click on edit of the first row ,could someone help me

In all honesty, I don’t know how you read that code and reason about it. You need to search the web for “how to style code effectively” or something similar. I’ve given up trying to parse it mentally. That said (and this is just a clue so that you might learn something)…

What is int rowIndex = 7 which appears at the end of the loop after having found an <a> element? Please explain what you believe that line is meant to achieve. Please explain how it will achieve whatever it is meant to achieve.

I think you made a series of cut/paste operations where you drew code from multiple sources and prayed to the gods of programming to make this work. That’s not how to program software. That’s not how to make things work in a robust fashion.

Please learn how to code!