Sahi headless execution with Mozilla Firefox
For Windows:
Section titled “For Windows:”-
Download latest version of Mozilla Firefox from https://www.mozilla.org/en-US/firefox/new/
-
On the Dashboard, click Add Browser. In
browser_types.xml, which opens, add:<browserType><name>firefoxHL</name><displayName>firefoxHL</displayName><icon>firefox.png</icon><path>$ProgramFiles\Mozilla Firefox\firefox.exe</path><options>-profile "$userDir/browser/ff/profiles/sahi$threadNo" -no-remote -headless</options><processName>firefox.exe</processName><capacity>5</capacity></browserType> -
Save and restart Sahi.
-
To run a test in Firefox headless: Click on “Bin” on the dashboard (or navigate to sahi/userdata/bin on a command prompt) and run the command
Terminal window testrunner.bat sahitests/sahi_demo.sah http://sahi.co.in/demo/ firefoxHL
For Linux:
Section titled “For Linux:”-
To check Firefox version, Open terminal and type (without quotes): “firefox –version” or “firefox -v” and it must appear Mozilla Firefox 55, or above.
-
On the Dashboard, click Add Browser. In
browser_types.xml, which opens, add this entry if it isn’t there:<browserType><name>firefoxHL</name><displayName>firefoxHL</displayName><icon>firefox.png</icon><path>/usr/bin/firefox</path><options>-profile "$userDir/browser/ff/profiles/sahi$threadNo" -no-remote -headless</options><processName>firefox</processName><capacity>5</capacity></browserType> -
Save and restart Sahi.
-
To run a test in Firefox headless: Open terminal, navigate to sahi/userdata/bin and run the command
Terminal window sh testrunner.sh sahitests/sahi_demo.sah http://sahi.co.in/demo/ firefoxHL
For Mac:
Section titled “For Mac:”-
To check Firefox version, Open terminal and type (without quotes): “firefox –version” or “firefox -v” and it must appear Mozilla Firefox 55, or above.
-
On the Dashboard, click Add Browser. In
browser_types.xml, which opens, add this entry if it isn’t there:<browserType><name>firefoxHL</name><displayName>FirefoxHL</displayName><icon>firefox.png</icon><path>open -n -a Firefox.app</path><options>--args -profile "$userDir/browser/ff/profiles/sahi$threadNo" -no-remote -headless</options><processName>Firefox</processName><capacity>5</capacity><force>true</force></browserType> -
Save and restart Sahi.
-
To run a test in Firefox headless: Open terminal, navigate to sahi/userdata/bin and run the command
Terminal window sh testrunner.sh sahitests/sahi_demo.sah http://sahi.co.in/demo/ firefoxHL
This will run the Sahi script without opening a browser.

