Page 1 of 1

how to check 'readonly' attr of input/textarea tag?

Posted: Fri May 21, 2010 8:57 am
by hobli
Hi,

I would like to check if an inputTag or textareaTag has "readonly" attribute, but I can not find methods/functions support this operation.

html code:
<input type=text readonly title="editbox title" name="editbox name" value="editbox value" >
<textarea readonly cols=2 rows=2 title="text area title" name="text area name" value="text area value">default txt</textarea>


is Ranorex2.3 support this attribute?

thanks

additon information: I am using Ranorex 2.3.1

Re: how to check 'readonly' attr of input/textarea tag?

Posted: Fri May 21, 2010 9:34 am
by Support Team
Hi,
hobli wrote:is Ranorex2.3 support this attribute?
You can use the Element class to GetAttributeValue of an item.
object input = inputTagEditbox_name.Element.GetAttributeValue("readonly");
object text = textAreaTagText_area_title.Element.GetAttributeValue("readonly");
Please take a look to the API Documentation
http://www.ranorex.com/Documentation/Ra ... lement.htm

Regards,
Peter
Ranorex Support Team

Re: how to check 'readonly' attr of input/textarea tag?

Posted: Mon May 24, 2010 1:35 am
by hobli
Hi,

thanks for your information.
I have tried with your code:

dim ipTag as inputTag = "<path>"
dim areaTag as textAreaTag = "path">

dim objIp as object
dim objArea as object

objIP = ipTag.Element.GetAttributeValue("readonly")
objArea = areaTag.Element.GetAttributeValue("readonly")

both objIP and objArea are null.

When I look at the ranorex spy on the specific web elelments, the 'readonly' attribute are not found.

sample html code:

<input type=text title="input editbox title" readonly name="input editbox name" value="input editbox value" id="editboxIp">
<textarea cols=20 rows=4 readonly title="text area title" name="text area name" value="text area value" id="editboxArea">default sdfstxt</textarea>

Please advise.

thanks

Re: how to check 'readonly' attr of input/textarea tag?

Posted: Tue May 25, 2010 3:06 pm
by Support Team
Hi,

You posted following http://www.ranorex.com/forum/how-to-get ... t1385.html
The bug fix in this posting refers to this error as well and is delivered with the next service release. At the moment it works only in Internet Explorer.

Thank you for posting,

Regards,
Peter
Ranorex Support Team