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

**URL:** <https://forum.katalon.com/t/using-global-variable-for-input-doesnt-write-all-the-chars/32682>\
**Category:** Web Testing\
**Tags:** katalon-studio\
**Created:** [September 6, 2019, 9:31am UTC](https://forum.katalon.com/t/using-global-variable-for-input-doesnt-write-all-the-chars/32682 "2019-09-06T09:31:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![spr2019](https://avatars.discourse-cdn.com/v4/letter/s/8e8cbc/32.png) [@spr2019](https://forum.katalon.com/u/spr2019)\
**Post date:** [September 6, 2019, 9:31am UTC](https://forum.katalon.com/t/using-global-variable-for-input-doesnt-write-all-the-chars/32682/1 "2019-09-06T09:31:04Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Russ\_Thomas](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/russ_thomas/32/11884_2.png) [@Russ\_Thomas](https://forum.katalon.com/u/Russ_Thomas)\
**Post date:** [September 6, 2019, 12:23pm UTC](https://forum.katalon.com/t/using-global-variable-for-input-doesnt-write-all-the-chars/32682/2 "2019-09-06T12:23:24Z")

</div>

> [@spr2019](#):
>
> 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.

Me too.

> [@spr2019](#):
>
> The method I use is settext. If I have a name like “client 258369”, the settext method can, for example, write “cient 2583”.

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](https://docs.katalon.com/katalon-studio/docs/webui-send-keys.html)

1. JavaScript

```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.

---

<div class="post-metadata">

**Author:** ![spr2019](https://avatars.discourse-cdn.com/v4/letter/s/8e8cbc/32.png) [@spr2019](https://forum.katalon.com/u/spr2019)\
**Post date:** [September 6, 2019, 12:31pm UTC](https://forum.katalon.com/t/using-global-variable-for-input-doesnt-write-all-the-chars/32682/3 "2019-09-06T12:31:06Z")

</div>

Hi Russ\_Thomas,

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

Thanks for your help.
