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.

What is the difference between exists and assert exists

dashboarddashboard Members
edited October 2013 in Sahi - Open Source
Hi

Can anyone explain the difference between the api's exists() and assertExists();

Because
_exists(_button("Download Trial" )); gives success wheras
_assertExists(_button("Download Trial" )); gives failure in my website.

Regards
Uday

Answers

  • Hi Uday,

    _exists() checks for the existence of the element and returns true if element exists on the page.
    _assertExists() will do nothing if the element exists and log failures to the playback logs if the element does not exist.

    Regards,
    Akash
  • Thanks very much Akash.

    Regards
    Uday
This discussion has been closed.