Using global variable for input doesn't write all the chars

Hi,

I am using Katalon Studio 6.2.1. I am using a Global variable to fill the client name in one of the fields of my application.

I have a println displaying my global variable in the script, and displays the correct value, but when writing the input, I see that some letters are missing, it is very weird.

The method I use is settext. If I have a name like “client 258369”, the settext method can, for example, write “cient 2583”.

I try to put a delay before writing, but it is not solving the problem.

Any help is welcome.

Me too.

I use JavaScript and that never happens.

Two things you can try:

  1. sendKeys

https://docs.katalon.com/katalon-studio/docs/webui-send-keys.html

  1. JavaScript
String js = "document.querySelector('css-selector-for-your-element').value = 'client 1234';"
WebUI.executeJavaScript(js, null)

Caveat: This may not trigger the native onchange handler on the element. I suspect there is an onchange handler on that element based on the evidence you’ve provided. F12 devtools will help you discover if that’s the case. Get back to me if there’s an issue.

1 Like

Hi Russ_Thomas,

Yes, sending keys and setting 500 milliseconds among each sendkeys did the trick.

Thanks for your help.

1 Like