Top Rounds
| We are Hiring! |
[Hide Navigation]

Running Tests on multiple machines ·

Sahi Pro can distribute and run tests on multiple machines (nodes)

Configuration:

  • Sahi Pro needs to be running on each machine
  • Browser paths need to be correctly specified in browser_types.xml on each node.
    Refer to this article for more details on how to configure browser_types.xml

Using the command line

drun.bat and drun.sh

Open sahi_pro/userdata/bin/drun.bat (drun.sh on linux) using any editor and configure the NODES variable to contain all the machines on which the tests should run.

E.g. –

On windows,
SET NODES=localhost:9999,machine2:9999,machine3:9999

On linux,
export NODES=localhost:9999,machine2:9999,machine3:9999

  1. Open a command prompt and cd to sahi/userdata/bin
    (or click on the “Bin” link on the Sahi Dashboard)
  2. Run drun.bat to see the syntax
    C:\sahi_pro\userdata\bin>drun.bat
    -- Usage: drun.bat <sah file|suite file> <startURL> <browserType> <tags> File path is relative to userdata/scripts tags are used only if the input suite is a csv file -- Example: drun.bat demo/demo.suite http://sahi.co.in/demo/ firefox drun.bat demo/sahi_demo.sah http://sahi.co.in/demo/ ie drun.bat demo/testcases/testcases_sample.csv http://sahi.co.in/demo/ ie "(user||admin)&&medium" --

To run your suite, use
cd sahi_pro\userdata\bin drun.bat demo/demo.suite http://sahi.co.in/demo/ firefox

Using ant

<taskdef name="sahid" classname="in.co.sahi.ant.DAntRunner" classpath="lib/ant-sahi.jar" /> <target name="drun"> <tstamp> <format property="ts" pattern="yyyy_MM_dd_HH_mm_ss" locale="en, IN" /> </tstamp> <property name="tempdest" value="scritps/${ts}" /> <sahid suite="${tempdest}/demo/demo.suite" baseurl="http://${urlbase}/demo/" sahihost="localhost" sahiport="9999" failureproperty="sahi.failed" haltonfailure="false" browserType="firefox"> <sync originFolder="userdata/scripts" destFolder="${tempdest}" ignorePattern=".*(svn|copied).*" /> <node host="localhost" port="9999" /> <node host="machine1" port="9999" /> <node host="machine2" port="9999" /> </sahid> <antcall target="failsahi" /> </target>




---


Top Rounds