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.

Continue on Error

jason.hamerjason.hamer Members
edited November -1 in Sahi - Open Source
I want my scripts to not stop if they fail but continue and log the failure. I tried to use contiueonerror as the code below and it does continue but shows that it passed.. please help

_continueOnError(_assertContainsText("Ask A Question", _span("Askffff A Questttion")));
_continueOnError(_assertContainsText("Ask A Question", _span("Ask A Question")));


Is there something I am doing incorrect??

Comments

  • narayannarayan Administrators
    _continueOnError() sets a flag so that the code that follows does not stop due to error.

    It should be used like this:
    _continueOnError();
    _assertContainsText("Ask A Question", _span("Askffff A Questttion"));
    // and other statements. 
    // Any errors will be reported but playback will not stop.
    _stopOnError();
    // Errors will now stop playback.
    

    Regards,
    Narayan
  • this fixed my issue thanks
  • Hi Narayan,

    what will be the replacement for _continueOnError() in java code for Sahi?

    I need it as i am converting my Sahi Framework from javascript to java.

    Please help me on that.

    Thanks, Deepak Verma
Sign In or Register to comment.