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.

Shutdown sahi.batch

Azhaguvel.AAzhaguvel.A Members
edited November -1 in Sahi - Open Source
Hi Team,

U have given sahi.batch in sahi installation folder to start sahi server like this how to shutdown sahi server through batch file.

Thanks,
Azhaguvel.A

Comments

  • globalwormingglobalworming Moderators
    edited September 2011
    did you started sahi with cmd?
    try Ctrl+C in the cmd
  • No I don't want cmd shorcut to stop server. I want batch file to stop server.
  • Hi guys,

    We are using ant to drive execution of regression test suite. And here we start and stop sahi server run time while execution of tests.

    Don't know exactly how to do it from batch file directly. But in our case we are just using following command in our Build.xml file to stop sahi.

    <antcall target="stopsahi"/>

    command which directs to :

    <target name="stopsahi" description="stop sahi server">
    <sahi stop="true" sahihost="localhost" sahiport="9999"/>
    </target>


    May be there is some code written in ant-sahi.jar used to stop sahi server while invoking above target.

    Narayan can give better idea about it. I am also eager to know how it can be done from command prompt without using "Ctrl + C".
  • I Unix environments you could use "lsof -i:9999" to get the Sahi process and shut him down.. unfortunatly, I don't know if there is something equal in Windows
  • Akss004Akss004 Members
    edited October 2011
    Hi,

    There is no commands in windows similar to "lsof -i:9999" of unix. However You can use combination of "TASKKILL" & "NETSTAT" as below to kill a sahi process which is running on port -9999.

    netstat -ano | find “9999″

    >return :TCP 0.0.0.0:9999 0.0.0.0:0 LISTENING 3140

    taskkill /PID 3140


    But how ever here we can't use it to execute from batch file as it requires manual intervention.... :(
  • Thanks AKASH, I have finished that with help of TASKKILL function.
  • narayannarayan Administrators
    Azhaguvel.A

    Please post the solution so that others may benefit.

    Thanks,
    Narayan
This discussion has been closed.