Katalon not removing default values from field

Hey,

I have started using katalon to automate my tests and everything is working great with a few little tweaks :slight_smile:

I have run into a problem where I have a series of financial fields that im trying to enter numeric values into but its always prefix with the default of 0.00. as an example if I use set text on this field to 5000 it enters 0.005000 which is slightly different to the 5000 I require :slight_smile:

I tried using the delay 1 second, set text to โ€˜โ€™ and then enter 5000 as I saw in another post and I get mixed results. about 10% of the time this may work. I have also tried using a data file to specify the values and this still doesnโ€™t work.

The below is the work around I saw on another post.
WebUI.delay(1)
WebUI.setText(findTestObject(โ€˜Object Repository/CRM/Page_Opportunity Opportunity New Opportunity - Microsoft Dynamics 365/input_FY - 20252026_idโ€™),
โ€˜โ€™)
WebUI.setText(findTestObject(โ€˜Object Repository/CRM/Page_Opportunity Opportunity New Opportunity - Microsoft Dynamics 365/input_FY - 20252026_idโ€™),
โ€˜5000โ€™)

I created this as a new thread as it seems a little different in that I know the fields are set to default to 0.00 for reporting purposes. If I click in the field manually the 0.00 does not appear so this must be getting set in the back end and triggered during the automation run.

Iโ€™m using Katalon v6.1.4 and Chrome v74.0.3729.131.

Any ideas?

On a side note im finding this automation tool simple to use and a great product for free. a lot of the other free products do not offer all the features of this so the little work arounds are ok all things considered.

Hi Jayster,

Try sendKeys. . .

//focus on the input field
WebUI.Click(findTestObject("Your_Input_Field"))

//or double click the input field to highlight the whole value before clearing it. .
WebUI.doubleClick(findTestObject("Your_Input_Field"))

WebUI.sendKeys(findTestObject("Your_Input_Field"), Keys.chord(Keys.BACK_SPACE))
WebUI.delay(1)
WebUI.sendKeys(findTestObject("Your_Input_Field"), "5000")

Hope that helps. . . :slight_smile:

3 Likes

Hey,

Yes this did fix it for me thank you! I had tried using send keys before but I didnโ€™t include the click action as well which has fixed it :slight_smile:

Thanks