Running JSystem scenario from command line

JSystem scenario is an ant script so running a scenario from command line is as simple as running ant script.

  1. Change directory to the runner installation folder (for example c:\jsystem\runner)
  2. Set ANT_HOME environment parameter
  3. When running on Linux Change ant batch file permission (chmod a+x ./thirdparty/ant/bin/ant)
  4. Make sure an empty ".testPropertiesFile_Empty" file exists under runner root folder

Linux

Assuming the following:
– Your automation project is under folder "/home/myuser/workspace/myProj"
– The runner is installed under /usr/jsystem/runner 
– The scenario that you want to execute is default.xml

Run ANT as follows:

#!/bin/bash
export ANT_HOME=<path_to_ant_home> (for example:./thirdparty/ant/)
export ANT_OPTS=-Djsystem.current.scenario.name=scenarios/default
<path_to_ant>/ant -Dbasedir=. -Dscenarios.base=/home/myuser/workspace/myProj/classes -lib /usr/jsystem/runner/thirdparty/commonLib -lib /usr/jsystem/runner/thirdparty/lib -lib /usr/jsystem/runner/lib -lib /usr/jsystem/runner/customer_lib -lib c:\workspace\myProj\lib -lib c:\workspace\myProj\classes
-f /home/myuser/workspace/classes/scenarios/default.xml

Windows

Assuming the following:

– Your automation project is under folder "c:\workspace\myProj" 
– The runner is installed at "c:\jsystem\runner"
– The scenario that you want to execute is default.xml

Run ant as follows:

set ANT_OPTS=-Djsystem.current.scenario.name=scenarios/default
<path_to_ant_bat>\ant.bat -Dbasedir=. -Dscenarios.base=c:\workspace\myProj\classes -lib c:\jsystem\runner\thirdparty\commonLib -lib c:\jsystem\runner\thirdparty\lib -lib c:\jsystem\runner\lib -lib c:\jsystem\runner\customer_lib -lib c:\workspace\myProj\lib -lib c:\workspace\myProj\classes -f c:\workspace\myProj\classes\scenarios\default.xml

Fork me on GitHub