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 prevent the browser from closing after executing in batch mode

chennapanchennapan Members
edited February 2013 in Sahi Pro
Currently upon executing a script in batch mode using testrunner.bat, the browser closes after execution. How to keep the browser open at the end of the execution? Is there a way to prevent the 'shutdown hook' from being automatically added?

Answers

  • Can you please tell me why you need to keep open your browser open after execution of the script.

    You can try to execute the scripts by Sahi controller, it will not close the browser.
  • We need to sequence the execution of scripts through another framework and hence the browser needs to remain open after the execution of a script. Using Sahi Controller is not an option since they need to be invoked from this framework. Currently we're able to achieve similar functionality for other test agents like QTP, Selenium,...
    Thanks.
    Chennapan
  • Hi Sahi Support,
    Can you please respond on this?
    Thanks.
    Chennapan
  • kshitijitukshitijitu Moderators
    Hi Chennapan,

    You can use the testrunner to run all the scripts one by by on the same browser session.

    You can refer the following URL to find more details about using the testrunner:

    http://sahi.co.in/w/Running+multiple+tests+in+batch+mode

    Please find the testrunner.bat(in case of windows machine, otherwise you can use testrunner.sh) in the directory "sahi_pro\userdata\bin\" and change:

    SET SINGLE_SESSION=false
    to
    SET SINGLE_SESSION=true

    Now you can run the suite file and all sah files will execute on the single session.

    --
    Thanks,
    Kshitij Gupta
Sign In or Register to comment.