18 January 2026:


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 get class attribute

PopeyePopeye Members
edited November -1 in Sahi - Open Source
Hi Forum,

I'm trying to get the class attribute from
<SPAN class="non_business_day">18</SPAN>
_alert(_assertExists(_span("18")));

displays true

_alert(_span("18").getAttribute("class"));

displays null

Any idea why getAttribute("class") returns null ?
Tagged:

Comments

  • narayannarayan Administrators
    Off hand, I would say you try _span("18").className to get the class.

    Not sure why getAttribute is not working. Will check.
  • Hi Narayan.

    thank you for the hint, .className works as expected.
This discussion has been closed.