Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to identify non-editable text field
#1
Solved: 11 Years, 3 Months, 3 Weeks ago Question 
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
Reply
#2
Solved: 11 Years, 3 Months, 3 Weeks ago
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!
Reply
#3
Solved: 11 Years, 3 Months, 3 Weeks ago
GetROProperty("disabled") =True,means that textbox is not editable
Reply
#4
Solved: 11 Years, 3 Months, 3 Weeks ago
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
Reply
#5
Solved: 11 Years, 3 Months, 3 Weeks ago
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.
Reply
#6
Solved: 11 Years, 3 Months, 3 Weeks ago
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>
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Read text from text file and save it into a variable in qtp arpan 3 12,957 06-19-2013, 08:34 PM
Last Post: arpan
  Need to compare two text files - ignoring some text nelly27281 2 4,578 09-09-2012, 12:09 PM
Last Post: freeboynil
Exclamation How to enter text in webedit field..... Unleash Rajesh 6 23,077 09-01-2011, 02:07 PM
Last Post: SQT
  Cell Editable or Not in JavaTable anshul.grg07 0 2,713 05-18-2011, 01:00 AM
Last Post: anshul.grg07
  Finding specific text in a text string janriis 3 5,504 10-08-2010, 04:00 PM
Last Post: KavitaPriyaCR

Forum Jump:


Users browsing this thread: 2 Guest(s)