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 Re-excute failed script from testrunner?

gligogligo Members
edited November -1 in Sahi - Open Source
Hello,
we are starting Sahi tests from one suite, using Ant every night.
Sometimes the tests ocasually fail. I want to make it so, that if the test fails, to be once again executed. So I can prove if the second time it passes...

Is there such a way to do this?

Many, many thanks for the help!

Comments

  • gligogligo Members
    So, there is nobody that execute this way or?
    I need to know if this is possible or not at least...
  • Hi gligo

    it may be possible to use maven/jenkins to run the ant task and define this kind of behavior.
    Alternatively, you could parse the index.html for failed scripts and if there are failed scripts, start another suite with the failed ones. Can you follow me?

    Regards
    Wormi
  • gligogligo Members
    Thank you Wormi. We are not using Maven, but can you explain me, how exactly I can parse the index.html and rerun the scripts, when and how should be this new suite created? should I write in a file, during the running process, in case of failure or?
  • Well, when using windows, you have to ask somebody else about the implementation. As a Unix user, I would first create a suiteStarter.sh, a shell script which starts your suite as usual, but at the end you search for the latest index.html and use awk like "awk '/FAILURE/ {print $filename}' index.html >> temp.suite" and then, if temp.suite is not empty, execute a second testsuite run.

    To summarize this, we need a batch/shellscript which:
    1. Executes a suite
    2. Reads the index.htm line by line and writes the filenames into another file when there is a "class=FAILURE" in the given line
    3. Executes a suite with the just created file

    Does this help you?
Sign In or Register to comment.