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.

Should Assertions in Sahi return any value?

sumeetsvaidyasumeetsvaidya Members
edited November -1 in Sahi - Open Source
Hello,

For past few days, I have been using Sahi. No doubt its a great tool, but one thing I didnt liked and after searching Sahi forum I found there are many people who think that Assertions should return true or false value.

If assertions start returning "true" or "false" value we can start using them in if statements and we can directly solve many problems.

Sahi dev. team think over it.

Thanks,
Sumeet

Comments

  • All Sahi users,

    Please provide your feedback regarding this post. I am pretty sure Narayan will also provide his valuable feeback.

    Thanks All,
    Sumeet
  • narayannarayan Administrators
    Hi Sumeet,

    This keeps coming up a lot, so let me explain again:

    _assertExists(_link("abcd"))

    means,


    if (!_condition(_exists(_link("abcd")))){
    _log("Link did not exist as a failure message")
    }

    For a condition, what you really need is

    if (_condition(_exists(_link("abcd")))){
    // your statements
    }

    In the next release of Sahi, you can do

    if (_exists(_link("abcd"))){
    // your statements
    }

    What ever you can do with assertions, you can do without the _assert part.
    If you need more help, post your case here, and we can explain how it should be done.

    Regards,
    Narayan
Sign In or Register to comment.