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.

Asserting The Class of a Link

dasspunkdasspunk Members
edited November -1 in Sahi - Open Source
Hmmm... struggling for too long with what is likely simple...

Given:
<a href="/admin.do" class="top_on">Admin</a>

How do I assert that my _link("Admin") is also of class "top_on"?

Thanks,
Brian

Comments

  • Hi Brian,

    You can use :

    _set($linkClass, _link("Admin").className);
    _assertEqual("top_on", $linkClass);

    Regards
    Sumitra
  • Perfect Sumitra... and I feel less dumb now 'cause that wasn't overly easy.

    FWIW, this wouldn't be a bad built-in function... checking the class of an object... or maybe not.

    Anyway, thanks,
    Brian
This discussion has been closed.