setText method is setting wrong number in the text field

I have the following script that enters the phone number in the text field. but when entered the first digit of the phone number is entering at the end of the number. Not sure if this is an application issue or the script issue.

Tried following methods and for all ways its same issue

WebElement phoneField= WebUI.findWebElement(findTestObject(‘Object Repository/Page_Unemployment Insurance/input_fieldName’, [(‘inputFieldName’) : ‘Phone Number’]))

phoneField.sendKeys(‘3234567892’)
WebUI.sendKeys(findTestObject(‘Object Repository/Page_Unemployment Insurance/input_fieldName’, [(‘inputFieldName’) : ‘Phone Number’]), ‘3234567892’)

WebUI.setText(findTestObject(‘Object Repository/Page_Unemployment Insurance/input_fieldName’, [(‘inputFieldName’) : ‘Phone Number’]), ‘3234567892’)
driver.findElement(By.xpath("//label[contains(text(),‘Phone Number’)]/…//input").sendkeys(‘3234567892’)

Which suggests to me it’s the AUT at fault.

Any idea of how to fix this. I tried converting to int, but I am getting error that the sendKeys cant apply java.util.long

Not sure if I understand properly, but could you clear the field before entering the text.

WebUI.clearText(findTestObject(‘Page_Unemployment Insurance/input_fieldName’,[(‘inputFieldName’) : ‘Phone Number’])

WebUI.setText(findTestObject(‘Page_Unemployment Insurance/input_fieldName’, [(‘inputFieldName’) : ‘Phone Number’]), ‘3234567892’)

Just a note that I do not use the format of the setText that you are using (I like the below method) so I am not sure of the method’s proper structure in your format.

'Input username'
WebUI.setText(findTestObject('Page_Login/txt_UserName'), Username)