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 read text from the spandiv
When I submit the a form with blank data, it shows me error messages for mandatory field. Below is the source of the page, I need help getting the error messages and storing in an array or variable
<li class='errorhalfrow'>
<fieldset id='noticeError' class='fieldset noticeError expanded' >
<div class='legend'><span class="icon"> </span>Errors<span class="shrinkicon"> </span></div>
<ol class="">
<li class="error"> Description isMandatory
</li>
<li class="error"> Severity isMandatory
</li>
<li class="error"> Type isMandatory
</li>
</ol>
<div class="FormContentBottomLeft"></div>
<div class="FormContentBottomRight"></div>
</fieldset>
</li>
<li class='errorhalfrow'>
<fieldset id='noticeError' class='fieldset noticeError expanded' >
<div class='legend'><span class="icon"> </span>Errors<span class="shrinkicon"> </span></div>
<ol class="">
<li class="error"> Description isMandatory
</li>
<li class="error"> Severity isMandatory
</li>
<li class="error"> Type isMandatory
</li>
</ol>
<div class="FormContentBottomLeft"></div>
<div class="FormContentBottomRight"></div>
</fieldset>
</li>
Comments
one thing i can suggest is if the position/location of the error node remains constant in the page's DOM then u can use
_getText(top.document.getElementsByTagName('li')[index of the 'li' node]).
If possible elaborate further on your requirement.
Regards,
Pankaj