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

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
hobli
Posts: 59
Joined: Thu Jul 30, 2009 1:15 am

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

Post by hobli » Fri May 21, 2010 8:57 am

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
Last edited by hobli on Mon May 24, 2010 9:52 am, edited 1 time in total.

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

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

Post by Support Team » Fri May 21, 2010 9:34 am

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

hobli
Posts: 59
Joined: Thu Jul 30, 2009 1:15 am

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

Post by hobli » Mon May 24, 2010 1:35 am

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

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

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

Post by Support Team » Tue May 25, 2010 3:06 pm

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