# Need to verify disabled textbox

**URL:** <https://forum.katalon.com/t/need-to-verify-disabled-textbox/25486>\
**Category:** Web Testing\
**Tags:** katalon-studio\
**Created:** [May 16, 2019, 1:32pm UTC](https://forum.katalon.com/t/need-to-verify-disabled-textbox/25486 "2019-05-16T13:32:20Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![vidushi.mittal](https://avatars.discourse-cdn.com/v4/letter/v/0ea827/32.png) [@vidushi.mittal](https://forum.katalon.com/u/vidushi.mittal)\
**Post date:** [May 16, 2019, 1:32pm UTC](https://forum.katalon.com/t/need-to-verify-disabled-textbox/25486/1 "2019-05-16T13:32:20Z")

</div>

Need to verify that text box is disabled. I have tried verifyelementnotclikable. It displays element is clickable and test case got failed. Please suggest  
Html:

---

<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:** [May 16, 2019, 1:44pm UTC](https://forum.katalon.com/t/need-to-verify-disabled-textbox/25486/2 "2019-05-16T13:44:19Z")

</div>

Assuming the HTML devs have coded your inputs to the HTML spec, then checking for the disabled attribute might (should?) work. The question I have is, what does Katalon do with a boolean attribute? It’s mere presence (with no assigned value) _means true_.

[https://docs.katalon.com/katalon-studio/docs/webui-get-attribute.html#description](https://docs.katalon.com/katalon-studio/docs/webui-get-attribute.html#description)

From MDN:

 ![image](https://europe1.discourse-cdn.com/katalon/original/2X/c/c92b9dc511f0b02cb4cd793610cc9ae5ff91c790.png)

> **[: The HTML Input element - HTML | MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input)**
>
> The HTML element is used to create interactive controls for web-based forms in order to accept data from the user; a wide variety of types of input data and control widgets are available, depending on the device and user agent. The element is one...

---

<div class="post-metadata">

**Author:** ![Brandon\_Hein](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/brandon_hein/32/1092_2.png) [@Brandon\_Hein](https://forum.katalon.com/u/Brandon_Hein)\
**Post date:** [May 16, 2019, 3:09pm UTC](https://forum.katalon.com/t/need-to-verify-disabled-textbox/25486/3 "2019-05-16T15:09:05Z")

</div>

Can you share the HTML for the text box, and maybe some of its parent elements? There is almost certainly some attribute that indicates whether the widget is disabled or not.

---

<div class="post-metadata">

**Author:** ![vidushi.mittal](https://avatars.discourse-cdn.com/v4/letter/v/0ea827/32.png) [@vidushi.mittal](https://forum.katalon.com/u/vidushi.mittal)\
**Post date:** [May 16, 2019, 3:17pm UTC](https://forum.katalon.com/t/need-to-verify-disabled-textbox/25486/4 "2019-05-16T15:17:55Z")

</div>

```auto
<input id="modifyHostsForm:idDnsIp0_0" type="text" name="modifyHostsForm:idDnsIp0_0" disabled>

```

---

<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:** [May 16, 2019, 3:20pm UTC](https://forum.katalon.com/t/need-to-verify-disabled-textbox/25486/5 "2019-05-16T15:20:24Z")

</div>

So what’s the issue? Use this like I said…

[https://docs.katalon.com/katalon-studio/docs/webui-get-attribute.html#description](https://docs.katalon.com/katalon-studio/docs/webui-get-attribute.html#description)

If you get issues, report back here…

---

<div class="post-metadata">

**Author:** ![Brandon\_Hein](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/brandon_hein/32/1092_2.png) [@Brandon\_Hein](https://forum.katalon.com/u/Brandon_Hein)\
**Post date:** [May 16, 2019, 3:22pm UTC](https://forum.katalon.com/t/need-to-verify-disabled-textbox/25486/6 "2019-05-16T15:22:07Z")

</div>

Agreed, I would try:

`assert WebUI.getAttribute(myTestObject, “disabled”) != null`

---

<div class="post-metadata">

**Author:** ![dfuentes](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/dfuentes/32/16104_2.png) [@dfuentes](https://forum.katalon.com/u/dfuentes)\
**Post date:** [September 4, 2021, 2:45am UTC](https://forum.katalon.com/t/need-to-verify-disabled-textbox/25486/7 "2021-09-04T02:45:01Z")

</div>

Use the Verify Element Has Attribute and Verify Element Not Has Attribute.

 ![image](https://europe1.discourse-cdn.com/katalon/original/3X/f/4/f40165bd6b25d6414023a83910551e9f3af770f6.png)

---

<div class="post-metadata">

**Author:** ![mohammad.sadique](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/mohammad.sadique/32/16104_2.png) [@mohammad.sadique](https://forum.katalon.com/u/mohammad.sadique)\
**Post date:** [December 15, 2021, 6:38am UTC](https://forum.katalon.com/t/need-to-verify-disabled-textbox/25486/8 "2021-12-15T06:38:16Z")

</div>

how to validate text of a disabled text box in katalone studio…please help here.

 ![image](https://europe1.discourse-cdn.com/katalon/original/3X/e/1/e1a789de903c7d44d445ca0f1fddb43365974fdf.png)

need to validate if the text - ‘PCAR001 - Private Car’ is expected or not,  
but somehow I am not able to do that since the text is disabled here.

---

<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:** [December 15, 2021, 4:40pm UTC](https://forum.katalon.com/t/need-to-verify-disabled-textbox/25486/9 "2021-12-15T16:40:51Z")

</div>

You should be able to see the HTML how the box is set to disabled. If there is an **attribute** that is stated, “disabled”, then how about:

```auto
WebUI.verifyElementAttributeValue(findTestObject('myPage/input_Product.PrivateCar'),
	"disabled", 'true', 10)
WebUI.verifyElementAttributeValue(findTestObject('myPage/input_Product.PrivateCar'),
	"value", 'PCAR001 - Private Car', 10)

```

or

```auto
pLabel = driver.findElement(By.xpath('id("input_Product.PrivateCar")'));
WebUI.verifyMatch(pLabel.getAttribute("disabled"), "true", false)
WebUI.verifyMatch(pLabel.getAttribute("value"), "PCAR001 - Private Car", false)

```

---

<div class="post-metadata">

**Author:** ![albert.vu](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/albert.vu/32/20595_2.png) [@albert.vu](https://forum.katalon.com/u/albert.vu)\
**Post date:** [August 8, 2022, 7:30am UTC](https://forum.katalon.com/t/need-to-verify-disabled-textbox/25486/10 "2022-08-08T07:30:07Z")

</div>

Archived on August 8, 2022, 7:30am UTC


