18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
How to check whethere textarea is disabled via sahi?
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">
<label>
Text - Description // name or header of field
<span id = "description">
Text – My description//Description entered in textarea
possible values
_span("My Description")
_label("Description")
_div("DescriptionMyDescription")
_div('divname");
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
//sample html
<div class="div name">
<div class="sub div name">
<label>
Text - Description // name or header of field
<span id = "description">
Text – My description//Description entered in textarea
possible values
_span("My Description")
_label("Description")
_div("DescriptionMyDescription")
_div('divname");
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
Answers
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.