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.

exit command between the 2 scripts

jeevarathinamsjeevarathinams Members
edited November -1 in Sahi - Open Source
Hi ,

I tried to run a test suite with 2 scripts. I have a script1 which has a loop.
My requirement is to break in between the loop present in script1 and move to the next script.
simply i can say an exit command from script1.But it should not exit the test suite instead it should move to the script2.


OS Name - Windows Xp

Browser Name and version - IE.8

Sahi Build - Sahi-V3.5

Kindly provide me the solution for this.

Thanks in Advance

Regards,
Jeeva

Comments

  • Hi jee

    I don't know if i understand you right... do you want to break the loop ( which would be a normal break statement I think ) or do you want script 2 to run and then continue the loop?
  • Hi jeeva,

    You should not be handling this at the suite level. You can modify script1 as follows,
    ....
    for(loop declaration){
    ...
    if(condition returns true){
    //Call script2
    _include("path/to/script2");
    //break out of the loop
    break;
    }
    }
    ...
    

    Let us know if you face any issues.

    Regards
    Theeran.
Sign In or Register to comment.