Micro Focus QTP (UFT) Forums
how to identify non-editable text field - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: how to identify non-editable text field (/Thread-how-to-identify-non-editable-text-field)



how to identify non-editable text field - rashkv - 04-11-2008

hi,

Could you please let me know how to identify a non editable text field.

I want to check if that field has become non editable or not.

thanks,
Rashmi


RE: how to identify non-editable text field - ConstantChange - 04-11-2008

Hi!

How about this:

Code:
set desc=Description.create
desc("html tag").value="INPUT"
desc("name").value="<TheNameOfYourTextField>"
set found=<YourParentPageObject>.childObjects(desc)

editable=found(0).getROProperty("enabled")

(or maybe the property is called "disabled", cant remember, but in case its called that then its:

editable=not found(0).getROProperty("disabled")

Cheers!


RE: how to identify non-editable text field - dhanasekars - 04-16-2008

GetROProperty("disabled") =True,means that textbox is not editable


RE: how to identify non-editable text field - pkjblog - 02-20-2014

i also had same problem, the text box got disabled on selecting a particular radio button. to verify this i tried all RO properties and got success through only 1 property changing, that is height.
Code:
x=browser(..).page(...).webedit(..).getROproperty("height")
if x=0 then
msgbox "text box disabled"
else
'enabled



RE: how to identify non-editable text field - guin.anirban - 02-24-2014

There are two ways to do it.

1. Try with GetROPRoperty("enabled") or GetROPRoperty("disabled") property. You will succeed 90% time by this.
2. Use error handling mechanism. Try to put some text in your textbox and capture the err.number. If error occurs then err.number will return non zero value, which in turn make your test pass otherwise fail. But keep your test inside error handling part.


RE: how to identify non-editable text field - nivedita - 10-10-2014

To identify whether a text object is non-editable, use "disabled" property. That is if "GetROProperty("disabled") = 1, then it means that the text object is non-editable.

Thanks,
Nivedita

<a href="http://www.indiumsoft.com/core-qa-offerings/test-automation" title="Test Automation"><strong>Test Automation</strong></a>