# Value is not printing in text box

**URL:** <https://forum.katalon.com/t/value-is-not-printing-in-text-box/87898>\
**Category:** Web Testing\
**Tags:** katalon-studio\
**Created:** [May 5, 2023, 6:47pm UTC](https://forum.katalon.com/t/value-is-not-printing-in-text-box/87898 "2023-05-05T18:47:45Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![usekatalon](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/usekatalon/32/16103_2.png) [@usekatalon](https://forum.katalon.com/u/usekatalon)\
**Post date:** [May 5, 2023, 6:47pm UTC](https://forum.katalon.com/t/value-is-not-printing-in-text-box/87898/1 "2023-05-05T18:47:45Z")

</div>

Its a normal textbox and the value is not printing either sending thru excel or hardcoded. working fine in local whereas not working in server. I have tried in different ways like by capturing a new control, setting with different properties i.e xpath, attribute, css still no luck.  
Please help if anyone has any answer

Thanks in Advance!!!

---

<div class="post-metadata">

**Author:** ![grylion54](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/grylion54/32/16265_2.png) [@grylion54](https://forum.katalon.com/u/grylion54)\
**Post date:** [May 5, 2023, 7:11pm UTC](https://forum.katalon.com/t/value-is-not-printing-in-text-box/87898/2 "2023-05-05T19:11:03Z")

</div>

Can you show some HTML of the textbox so we can get more information on your concern?  
Are you getting any error message or any feedback from KS when you do your setText()?

---

<div class="post-metadata">

**Author:** ![usekatalon](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/usekatalon/32/16103_2.png) [@usekatalon](https://forum.katalon.com/u/usekatalon)\
**Post date:** [May 5, 2023, 7:18pm UTC](https://forum.katalon.com/t/value-is-not-printing-in-text-box/87898/4 "2023-05-05T19:18:52Z")

</div>

Here is the html code

input class=“class1” data-val=“true” data-val-length=“Zip Code must be 10 digits.” data-val-length-max=“10” id=“PostalCode” maxlength=“10” name=“PostalCode” type=“text” value=“” autocomplete=“off”

not seeing any errors in console

---

<div class="post-metadata">

**Author:** ![grylion54](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/grylion54/32/16265_2.png) [@grylion54](https://forum.katalon.com/u/grylion54)\
**Post date:** [May 5, 2023, 7:32pm UTC](https://forum.katalon.com/t/value-is-not-printing-in-text-box/87898/5 "2023-05-05T19:32:35Z")

</div>

> [@usekatalon](#):
>
> Zip Code must be 10 digits.

And what is the **setText** () statement you are using?

---

<div class="post-metadata">

**Author:** ![usekatalon](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/usekatalon/32/16103_2.png) [@usekatalon](https://forum.katalon.com/u/usekatalon)\
**Post date:** [May 5, 2023, 7:49pm UTC](https://forum.katalon.com/t/value-is-not-printing-in-text-box/87898/6 "2023-05-05T19:49:33Z")

</div>

excel  
WebUI.setText(findTestObject(‘input\_PostalCode’), findTestData(‘CreateNewLocations’).getValue(17, 1))  
hard code  
WebUI.setText(findTestObject(‘input\_PostalCode’), ‘61701’)

---

<div class="post-metadata">

**Author:** ![grylion54](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/grylion54/32/16265_2.png) [@grylion54](https://forum.katalon.com/u/grylion54)\
**Post date:** [May 5, 2023, 9:26pm UTC](https://forum.katalon.com/t/value-is-not-printing-in-text-box/87898/7 "2023-05-05T21:26:08Z")

</div>

The “error” message indicates your Zip Code **must** be 10 digits (and I remember the TV show, ‘90210’, so 5 digits should be allowed) so is this a “bug” that you have found? Are you able to enter ‘61701’ **manually** into the textbox?

And, just curious, is there another textbox, or radio button, that dictates whether or not to use Canadian Postal Codes or American Zip Codes? Note: Canadian Postal Codes are ‘AnA nAn’ (alphanumeric), like T2G 1P7.

---

<div class="post-metadata">

**Author:** ![usekatalon](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/usekatalon/32/16103_2.png) [@usekatalon](https://forum.katalon.com/u/usekatalon)\
**Post date:** [May 5, 2023, 10:27pm UTC](https://forum.katalon.com/t/value-is-not-printing-in-text-box/87898/8 "2023-05-05T22:27:15Z")

</div>

that is just a validation message to display if the User enters less than 10 digits. moreover it is working fine in my local with the same code.

---

<div class="post-metadata">

**Author:** ![usekatalon](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/usekatalon/32/16103_2.png) [@usekatalon](https://forum.katalon.com/u/usekatalon)\
**Post date:** [May 5, 2023, 10:28pm UTC](https://forum.katalon.com/t/value-is-not-printing-in-text-box/87898/9 "2023-05-05T22:28:06Z")

</div>

It can accept numerics only

---

<div class="post-metadata">

**Author:** ![grylion54](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/grylion54/32/16265_2.png) [@grylion54](https://forum.katalon.com/u/grylion54)\
**Post date:** [May 6, 2023, 4:35am UTC](https://forum.katalon.com/t/value-is-not-printing-in-text-box/87898/10 "2023-05-06T04:35:33Z")

</div>

First try replacing setText with sendKeys instead. See if that changes anything.

```auto
WebUI.sendKeys(findTestObject('input_PostalCode'), '61701')

```

I remember there was another OP that had an issue with entering numbers into a textbox and I believe he had to enter them one at a time, using sendKeys. It was on this forum somewhere. That’s another thing to try. If something like it works, then you can make a Keyword out of it with perhaps a **loop and substring()** parsing method.

Edit: Here are some other ideas:

> [@Trying to slow down WebUI.sendkeys](http://forum.katalon.com/t/trying-to-slow-down-webui-sendkeys/22843/2):
>
> Hello, this works well for me - String cardNo = "1111222233334444" char[] cardNoArray = cardNo.toCharArray() for(char ch in cardNoArray) { WebUI.sendKeys(inputTestObject, ch.toString()) Thread.sleep(100) } Change sleep argument if 100ms is too short period.

> [@SetText to numeric value only input](http://forum.katalon.com/t/settext-to-numeric-value-only-input/26042/6):
>
> I used a Focus() and SendKeys and it worked, thanks!

---

<div class="post-metadata">

**Author:** ![usekatalon](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/usekatalon/32/16103_2.png) [@usekatalon](https://forum.katalon.com/u/usekatalon)\
**Post date:** [May 10, 2023, 3:53pm UTC](https://forum.katalon.com/t/value-is-not-printing-in-text-box/87898/11 "2023-05-10T15:53:10Z")

</div>

Thanks alot Grylion for your help. 🙂  
tried with all of them still no luck.

---

<div class="post-metadata">

**Author:** ![grylion54](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/grylion54/32/16265_2.png) [@grylion54](https://forum.katalon.com/u/grylion54)\
**Post date:** [May 10, 2023, 5:44pm UTC](https://forum.katalon.com/t/value-is-not-printing-in-text-box/87898/12 "2023-05-10T17:44:01Z")

</div>

What about adding a **waitFor** statement before the setText.

```auto
WebUI.waitForElementClickable(findTestObject('input_PostalCode'), 10)
WebUI.sendKeys(findTestObject('input_PostalCode'), '61701')
WebUI.verifyElementAttributeValue(findTestObject('input_PostalCode'), "value", '61701', 10)

```

---

<div class="post-metadata">

**Author:** ![usekatalon](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/usekatalon/32/16103_2.png) [@usekatalon](https://forum.katalon.com/u/usekatalon)\
**Post date:** [May 15, 2023, 3:26pm UTC](https://forum.katalon.com/t/value-is-not-printing-in-text-box/87898/13 "2023-05-15T15:26:05Z")

</div>

sorry no luck with the above code also

---

<div class="post-metadata">

**Author:** ![mwarren04011990](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/mwarren04011990/32/26024_2.png) [@mwarren04011990](https://forum.katalon.com/u/mwarren04011990)\
**Post date:** [May 15, 2023, 4:51pm UTC](https://forum.katalon.com/t/value-is-not-printing-in-text-box/87898/14 "2023-05-15T16:51:18Z")

</div>

Did you mean `WebUI.waitForElementVisible(textField)` ?

---

<div class="post-metadata">

**Author:** ![grylion54](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/grylion54/32/16265_2.png) [@grylion54](https://forum.katalon.com/u/grylion54)\
**Post date:** [May 15, 2023, 4:55pm UTC](https://forum.katalon.com/t/value-is-not-printing-in-text-box/87898/15 "2023-05-15T16:55:01Z")

</div>

“Clickable” is supposed to indicate the element is Present, which is not the same as “Visible”, however, it was a stab in the dark why the “sendKeys” was not working.

---

<div class="post-metadata">

**Author:** ![usekatalon](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/usekatalon/32/16103_2.png) [@usekatalon](https://forum.katalon.com/u/usekatalon)\
**Post date:** [May 15, 2023, 10:39pm UTC](https://forum.katalon.com/t/value-is-not-printing-in-text-box/87898/16 "2023-05-15T22:39:23Z")

</div>

Finally it worked with the below code

String zipcodevalue = findTestData(‘excel suite’).getValue(17, 1)  
String js = “”"  
var ssn = document.querySelector(‘#PostalCode’);  
ssn.value = ‘${zipcodevalue}’;

“”"  
WebUI.executeJavaScript(js, null)

Thanks alot for all your time and help. 🙂
