18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
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.
Start sahi proxy (dashboard) from java environment
We would like to start Sahi dashboard from within our Java code to integrate sahi with our existing test automation framework.
I found that I can call Dashboard.main() method from the Java code which will start the dashboard but it requires two arguments passed to it. These are "Sahi Home" and "Sahi User Data Dir".
Rather than using the whole directories, I want to know, which files are required to start the Sahi dashboard so that I can keep the Sahi folder to the minimum size.
So my question is-
What exact files and folders are required to start sahi dashboard using Dashboard.main(...) method.
Thanks,
Aakash
I found that I can call Dashboard.main() method from the Java code which will start the dashboard but it requires two arguments passed to it. These are "Sahi Home" and "Sahi User Data Dir".
Rather than using the whole directories, I want to know, which files are required to start the Sahi dashboard so that I can keep the Sahi folder to the minimum size.
So my question is-
What exact files and folders are required to start sahi dashboard using Dashboard.main(...) method.
Thanks,
Aakash
Comments
Please look in to windows batch commands which starts Sahi,
In the above example, we are considering that Sahi is installed at "C:\user\sahi"
Regards
Sumitra
Apparently this starts the proxy for sahi, but I have a big problem. I cannot check if the proxy server is already started. isRunning() method returns false even if I see in the console "ERROR: Port 9999 is already being used".
How can I bypass this? The easiest way would be that proxy. start() would return an int or boolean instead of void.
Any suggestions would be appreciated.
Thnak you
There are chances that there are other instance of Sahi running and which is using port 9999.
So could you please close all instance of Sahi and check ?
Regards
Sumitra
Basically I want my tests to start a proxy if another is not already started, or use the existing started proxy if exists. How can I check this?
Is there a way to kill the existing proxy process? What is his name in tasklist?
Thanks
Have a look at :
http://sahi.co.in/java/javadocs/net/sf/sahi/Proxy.html
http://sahi.co.in/forums/viewtopic.php?id=3126
Let me know if this solves your issue.
Regards
Sumitra
Thank you for the answers.
The good news is that is OK to use a bat file to stop the already running proxy, but I find this a little awkward and not very elegant.
The bad news is that proxy.stop() doesn't work for an existing running proxy.
Regards