Please note that Sahi's development and support teams do not actively monitor this. This is more a community forum. If you are a Sahi Pro user looking for commercial support, please email support @ with your query.

How to check whethere textarea is disabled via sahi?

sridatta_spsridatta_sp Members
edited June 2014 in Sahi - Open Source
We have a usecase where both fieldname and its textarea are disabled, we have to confirm that textarea is not editable. How do we do it?

//sample html
<div class="div name">
<div class="sub div name">
Text - Description // name or header of field
<span id = "description">
Text – My description//Description entered in textarea

possible values
_span("My Description")

I tried below assert statements and none worked
_assertTrue(_label("description").disabled); [Assertion Failed]
_assertTrue(_label("description").readOnly); [Assertion Failed]
_assertTrue(_textarea("description").readOnly); Error: Cannot read property 'disabled' of undefinedTypeError:
_assertTrue(_textarea("description").disabled); Error: Cannot read property 'disabled' of undefinedTypeError:
_assertTrue(_in(_div("divname")).disabled); [Assertion Failed]

kindly help


  • SadanaSadana Members
    Oh, this is always a tricky one. :)
    And it would be great if somebody can tell the absolute solution.

    Disabling the element can happen in many levels. I can be targeted to one single element, but also it can be somewhere in higher level and then it's targeted to the group of the elements.

    So if there is no disabled attribute set to the single element, then you check does it belong to higher group which is disabled.

    Stupid thing is that even then there is a change it's not disabled. Some time ago I was checking disabling manually and noticed one browser version didn't react at all to disabled attribute.
Sign In or Register to comment.