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.

Repeating a script

yellowg555yellowg555 Members
edited November -1 in Sahi - Open Source
Hey guys, great product you guys made! I was wondering if there is any way to repeat a script X times?

Thanks in advance.

Comments

  • narayannarayan Administrators
    You can put your script into a loop in another script.
    var $count = 0
    while ($count < 20){
       try{
          // your steps
          // or
          // use _include
          // _include("file_with_my_steps");
       }catch(e){
          _log("Problem in run:" + $count);
          _logExceptionAsFailure(e);
       }
    }
    
  • is it possible to use a variable in the _include command for the path of the script
  • narayannarayan Administrators
    No, UmaShankar, it is not possible to use a variable in _include.

    You may create a function inside the included file and call it only when you want it. You can be including multiple files but be invoking only the required function.
Sign In or Register to comment.