I looked at your concern again and I encountered an issue with the counting of the number of rows in the table every so often, so I added a hard coded delay() to my routine, but you can perhaps put in a waitFor statement to reduce the time.
You can create TestObjects of my pathways, including the one in which I do a substitution–for that one you will have to look up KS parameterization, which is discussed on this forum and in their documentation.
Maybe like:
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import org.openqa.selenium.Keys as Keys
import org.openqa.selenium.By as By
import org.openqa.selenium.WebDriver as WebDriver
import org.openqa.selenium.WebElement as WebElement
import com.kms.katalon.core.webui.driver.DriverFactory as DriverFactory
import com.kms.katalon.core.model.FailureHandling as FailureHandling
import com.kms.katalon.core.testcase.TestCase as TestCase
import com.kms.katalon.core.testobject.TestObject as TestObject
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import internal.GlobalVariable as GlobalVariable
WebUI.openBrowser('')
WebUI.navigateToUrl('https://emze-test.login.ap2.oraclecloud.com')
WebUI.maximizeWindow()
def driver = DriverFactory.getWebDriver()
WebUI.waitForElementVisible(findTestObject('Object Repository/Page_Sign In/input_User ID_userid'), 10)
WebUI.setText(findTestObject('Object Repository/Page_Sign In/input_User ID_userid'), 'santhosh.khati@cultfit.in')
WebUI.setEncryptedText(findTestObject('Object Repository/Page_Sign In/input_Password_password'), 'up+3IOQy8oYM6+J9+4ucbw==')
WebUI.click(findTestObject('Object Repository/Page_Sign In/button_Sign In'))
WebUI.waitForPageLoad(10)
WebUI.click(findTestObject('Object Repository/Page_Welcome/svg_Favorites and Recent Items'))
WebUI.waitForPageLoad(10)
WebUI.waitForElementVisible(indTestObject('Object Repository/Page_Welcome/span_Manage Transactions'), 10)
WebUI.click(findTestObject('Object Repository/Page_Welcome/span_Manage Transactions'))
WebUI.waitForElementVisible(findTestObject('Object Repository/Page_Manage Transactions - Billing - Oracle_c9685a/input_Transaction Number Operator__FOpt1_FO_3eed66'), 10)
WebUI.setText(findTestObject('Object Repository/Page_Manage Transactions - Billing - Oracle_c9685a/input_Transaction Number Operator__FOpt1_FO_3eed66'), '240006')
WebUI.click(findTestObject('Object Repository/Page_Manage Transactions - Billing - Oracle_c9685a/button_Search'))
WebUI.waitForPageLoad(30)
WebUI.waitForElementVisible(findTestObject('Object Repository/Page_Manage Transactions - Billing - Oracle_c9685a/img_Reorder Columns__FOpt1_FOr10_FOSritemNo_901715'), 10)
WebUI.click(findTestObject('Object Repository/Page_Manage Transactions - Billing - Oracle_c9685a/img_Reorder Columns__FOpt1_FOr10_FOSritemNo_901715'))
WebUI.waitForElementVisible(findTestObject('Object Repository/Page_Manage Transactions - Billing - Oracle_c9685a/img_Reorder Columns__FOpt1_FOr10_FOSritemNo_6c0eed'), 10)
WebUI.click(findTestObject('Object Repository/Page_Manage Transactions - Billing - Oracle_c9685a/img_Reorder Columns__FOpt1_FOr10_FOSritemNo_6c0eed'))
// sorry, but I could not determine where these fields were
WebUI.click(findTestObject('Object Repository/Page_Manage Transactions - Billing - Oracle_c9685a/input_Number of Periods__FOpt1_FOr10_FOSrit_2e6301'))
WebUI.setText(findTestObject('Object Repository/Page_Manage Transactions - Billing - Oracle_c9685a/input_Assessable Value__FOpt1_FOr10_FOSrite_f82baf'), '2')
"drop down the page to the Incomplete phrase"
pItem = driver.findElement(By.xpath('//td[text()="Incomplete"]'))
WebUI.scrollToPosition(100, pItem.getLocation().getY())
WebUI.delay(3) // put in a hard coded delay
"get the count of rows in the table"
List<WebElement> list = driver.findElements(By.xpath('//input[contains(@id,"_FOpt1:_FOr1:0:_FOSritemNode_receivables_billing:0:MAnt2:0:pt1:MTF1:1:pt1:Trans1:0:ap110:AT1:_ATp:table1:") and contains(@id, ":it27::content")]'))
rowCount = list.size() // this is the number of rows in the table
WebUI.comment("Count is ${rowCount}")
xpathway = "id('_FOpt1:_FOr1:0:_FOSritemNode_receivables_billing:0:MAnt2:0:pt1:MTF1:1:pt1:Trans1:0:ap110:AT1:_ATp:table1:${rowCount-1}:it27::content')"
"lets look at the pathway"
WebUI.comment("pathway is ${xpathway}")
cellItem = driver.findElement(By.xpath(xpathway))
"put in the text"
cellItem.sendKeys("2nd line data")