Add numbers in field

have one problem on my webpage there is field which can be filled only with digits, it is ID.

The problem is that i need to enter every time different ID number, so i need to randomly generate it and fill into my form.
here is my code example

int randomDigits
randomDigits = (Math.random()*10000000000)
int a=randomDigits'Object Repository/step1/id_card_number'))
WebUI.setText(findTestObject('Object Repository/step1/id_card_number'),  randomDigits )
WebUI.setText(findTestObject('Object Repository/step1/id_card_number'),  '1234' )
WebUI.sendKeys(findTestObject('Object Repository/step1/id_card_number'), Keys.chord('1234'))
WebUI.setText(findTestObject('Object Repository/step1/id_card_number'),  randomDigits )

this part throw error

2021-09-16 15:21:39.284 DEBUG testcase.Registration_full               - 15: setText(findTestObject("Object Repository/step1/id_card_number"), randomDigits)
2021-09-16 15:21:39.354 ERROR c.k.katalon.core.main.TestCaseExecutor   - ❌ Test Cases/Registration/Registration_full FAILED.
groovy.lang.MissingMethodException: No signature of method: static com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.setText() is applicable for argument types: (com.kms.katalon.core.testobject.TestObject, java.lang.Integer) values: [TestObject - 'Object Repository/step1/id_card_number', 344799900]
Possible solutions: setText(com.kms.katalon.core.testobject.TestObject, java.lang.String), getText(com.kms.katalon.core.testobject.TestObject), getText(com.kms.katalon.core.testobject.TestObject, com.kms.katalon.core.model.FailureHandling), setText(com.kms.katalon.core.testobject.TestObject, java.lang.String, com.kms.katalon.core.model.FailureHandling), clearText(com.kms.katalon.core.testobject.TestObject), clearText(com.kms.katalon.core.testobject.TestObject, com.kms.katalon.core.model.FailureHandling)
	at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(
	at com.kms.katalon.core.main.TestCaseExecutor.runScript(
	at com.kms.katalon.core.main.TestCaseExecutor.doExecute(
	at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(
	at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(
	at com.kms.katalon.core.main.TestCaseExecutor.execute(
	at com.kms.katalon.core.main.TestCaseMain.runTestCase(
	at com.kms.katalon.core.main.TestCaseMain.runTestCase(
	at com.kms.katalon.core.main.TestCaseMain$runTestCase$ Source)

but other two settext and sendkeys to nothing.

Can someone help me with this issue. I need somehow take random 10 digits (only integer) and put in into my field

you need to call .toString() on the randomDigits'Object Repository/step1/id_card_number'))
WebUI.setText(findTestObject('Object Repository/step1/id_card_number'),  randomDigits.toString() )

tried like this, no error but the field did not filled with digits, stays empty.

there’s several reasons that COULD cause this
one would be that your xpath is wrong(and not selecting the correct input), you should verify that first
another possibility is that the input is cleared afterward(could be as a result from you clicking on it)
another could be because of the validation on that field that clears it under wrong input

what you should do is, first, do everything manually, with correct data so you can go to the next step
then try to replicate that exact input through automation
and THEN you should look into randomizing the input

if you still can’t find the solution, it would be helpful to share the selection method and the selector, as defined in katalon for the testobject

found a workaround, if I paste ID in another field with ‘-’ signs and then send key CTRL+A ,CTRL+C, i can paste it in card id field

int random_7_Digits
random_7_Digits = (Math.random()*10000000)
//generate random id number
id_number = '13-'+ random_7_Digits + '-1'
//copy the id number into mail and paste in id field
WebUI.setText(findTestObject('Object Repository/step1/mail'), id_number)
WebUI.sendKeys(findTestObject('Object Repository/step1/mail'), Keys.chord(Keys.CONTROL, 'a'))
WebUI.sendKeys(findTestObject('Object Repository/step1/mail'), Keys.chord(Keys.CONTROL, 'c'))'Object Repository/step1/id_card_number'))
WebUI.sendKeys(findTestObject('Object Repository/step1/id_card_number'), Keys.chord(Keys.CONTROL, 'v'))

here is atribute settings

very strange why i cant just type text in field, first time i see this kind of fields

Try sendKeys() for the whole string of characters. Some input controls need to “sense” keypresses.