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.
Trouble getting an automation suite to work
I'm trying to get a batch of tests to run automatically using the commandline and Firefox but encountering the "Firefox is already running, but is not responding" error.
Here's my script start command:
Any ideas?
Here's my script start command:
java -cp "C:\Documents and Settings\tester1\Desktop\sahi\lib\ant-sahi.jar" net.sf.sahi.test.TestRunner "C:/Documents and Settings/tester1/Desktop/sahi/scripts/Canary/Canary.Suite" "C:\Program Files\Mozilla Firefox\firefox.exe" http://test.server.example.com:9891/select/home default localhost 9999 3 "-profile C:\Documents and Settings\tester1\Desktop\sahi\browser\ff\profiles\sahi$threadNo"
Here's my Sahi.bat
SET EXT_CLASS_PATH=..\extlib\mysql-connector-java-5.0.4-bin.jar
SET SAHI_CLASS_PATH=..\lib\sahi.jar;
SET MOZ_NO_REMOTE=1
java -classpath %EXT_CLASS_PATH%;%SAHI_CLASS_PATH% net.sf.sahi.Proxy
Restarting Firefox or the system doesn't eliminate the error. Click "OK" on the dialogs and attempting to run again isn't helping either.Any ideas?
Comments
Have you considered using ant to run the test automatically? The sahi distribution comes with an example ant script. It will take the pain out of trying to write a startup script.
regarding the error - if there are any instances of firefox running on your system the controller will not be able to start one to exectute the script in. Or if there is a stuck firefox process (look for firefox.exe in the task manager) then that will also block firefox starting.
If that doesn't work, then try switching to IE and see what happens.
John
I tried using ant and batch to run sahi suites. Everything works fine except one thing. I am not able to run the proxy through the ant/batch.
Whenever I try to do so, the proxy takes some seconds to start and in the meanwhile the suite-runner not finding the proxy running fails throwing errors on the console. On the other hand if I run the same suite after manually running the proxy and then running the suite through ant/batch file it runs fine.
Any suggestions please?
Regards,
Pankaj.
PS: Same happened when i tried the demo suite thats available with sahi.
This is my suite.xml: any thoughts?
Regards,
Pankaj.
Could get around the problem with this: But one issue i am facing now is that while running the suite i am getting various browser warnings like another instance already running, first close it etc. I think sahi is not able to pick the right profile. It also shows warning for resume from crash.
Any thoughts on this?
Regards,
Pankaj.
I got the solution for my problem. Thanks to Narayan. Heres what he guided:
================================================
We need to have system property MOZ_NO_REMOTE=1 if we want to run
multiple profiles. This should be set before you start Sahi, in
sahi.bat or which ever way you start Sahi.
If you are using an older Sahi:
I would suggest deleting all profiles in sahi/browser/ff/profiles folder.
Download a new version of Sahi. There will be a folder called
sahi/config/ff_profile_template. It just has a prefs.js. You can
delete your sahi/config/ff_profile_template and copy this folder from
the latest build. This has the correct preferences. Then restart Sahi.
Sahi will copy this template 10 times into sahi/browser/ff/profiles to
create 10 profile folders.
Try running the suite again. This time accept the alerts if they come,
once. The next run onwards things should work fine.
If you still have problems, start firefox with
sahi/config/ff_profile_template as your profile. You can do this by
firefox -profile sahi/config/ff_profile_template. When firefox starts,
modify the preferences you want. The again delete profiles in
sahi/browser/ff/profiles, and restart Sahi. This will again copy your
template profile into the profiles folder 10 times. You should then
have the same profile settings in each of your 10 profiles.
============================================
I followed the steps for older sahi and it worked.
Thanks Narayan and all the wonderful guys out there!
Pankaj.