Katalon reads 'number' type of variable as string

Hi everyone,

I have problem with my number variable read as string. I do API POST testing.
Have tried to convert string to integer using ‘as Integer’ as suggested from others thread, but no luck.

def fullnames = “${full_name}” as Integer

ResponseObject response = WS.sendRequest(findTestObject(‘Basic User/Add User’, [(‘full_name’) : fullnames

Any helps would be appreciated
Thanks in advance

When I hover my mouse over the variable, fullnames, I get the reference as an Integer. However, when I put the statement in a small program, I get a NumberFormatException.

//def full_name = "grylion54"
def full_name = ""

def fullnames = "${full_name}" as Integer

WebUI.comment("the name is ${fullnames}")

It’s likely the contents in "${full_name}" is not something that can be converted into an Integer, like an empty String or character String, such as “ronny27006” or “grylion54”. Perhaps put a WebUI.comment("the name is ${fullnames}") or println("the name is ${fullnames}") just after the statement to see what its contents are, like I have done above.

As a note, the below works.

def full_name = "6"

def fullnames = "${full_name}" as Integer

WebUI.comment("the name is ${fullnames}")

Ouput: the name is 6

Thanks for the reply. My variable is string, and I tried to convert to integer using this syntax:

def fullnames = “${full_name}” as Integer

I still got the same result, katalon reads it as string, because I successfully hit the POST API (which has validation if we input integer type)

I used println and the result is 123123, which i assumed is string type

I am so sorry, my mistake creating object repository (API) request body variable with:


Making all the value send to OR:


Instead, I use


and problem is solved. Sorry for my mistakes.

Thankyou for the feedback