How to get text length from a field using Get Attribute value method

I am able to fetch text value from a text field but How to get text length from a field using Get Attribute value method

You just get length directly from that text value using length() function, that’s all:

String text = WebUI.getAttributeValue()
println text.length()

Katalon Test script was looping on all rows but after inserting above lines, script is looping only once. don’t know what might be the issue…

for (def rownbr = 1; rownbr <= findTestData(‘SPIProject’).getRowNumbers(); rownbr++) {
‘To Open Browser’
WebUI.openBrowser(’’)

'Navigating to link provided as Input to TCase'
WebUI.navigateToUrl('https://www.spiproject.com/spiproject/')

'Wait for page to Load'
WebUI.waitForPageLoad(5)

'Maximizing Browser Window'
WebUI.maximizeWindow()

'Taking Screenshot'
WebUI.takeScreenshot()

'Moving Mouse Over Object'
WebUI.mouseOver(findTestObject('SPI_Project/Page_SV Project - Softvision Projec/input_Login1UserName'))

'Setting Focus on Test Object'
WebUI.focus(findTestObject('SPI_Project/Page_SV Project - Softvision Projec/input_Login1UserName'))

'Verifying weather Test Element is present on AUT or not'
WebUI.verifyElementVisible(findTestObject('SPI_Project/Page_SV Project - Softvision Projec/input_Login1UserName'))

WebUI.setText(findTestObject('SPI_Project/Page_SV Project - Softvision Projec/input_Login1UserName'), findTestData('SPIProject').getValue(
        'UserNames', rownbr))

WebUI.getText(findTestObject('SPI_Project/Page_SV Project - Softvision Projec/input_Login1UserName'))

WebUI.delay(2)

String t = WebUI.getAttribute(findTestObject('SPI_Project/Page_SV Project - Softvision Projec/input_Login1UserName'), 
    findTestData('SPIProject').getValue('UserNames', rownbr))

println(t.length())

WebUI.click(findTestObject('SPI_Project/Page_SV Project - Softvision Projec/input_Login1LoginButton'))

WebUI.closeBrowser()

}

There are no problems with above script. Can you double check again your execution?

yeah, there is no problems with this script, but after inserting

String text = WebUI.getAttributeValue()
println text.length()

script is not looping based on my test inputs through excel sheet.

Need urgent help.