Skip to content
Get Free Trial

Sahi headless execution with Mozilla Firefox

  1. Download latest version of Mozilla Firefox from https://www.mozilla.org/en-US/firefox/new/

  2. 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>
  3. Save and restart Sahi.

  4. 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
  1. To check Firefox version, Open terminal and type (without quotes): “firefox –version” or “firefox -v” and it must appear Mozilla Firefox 55, or above.

  2. 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>
  3. Save and restart Sahi.

  4. 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
  1. To check Firefox version, Open terminal and type (without quotes): “firefox –version” or “firefox -v” and it must appear Mozilla Firefox 55, or above.

  2. 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>
  3. Save and restart Sahi.

  4. 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.