Playback via Command Line
abstract
During development, scripts will be played back from the Controller or Editor.
For Continuous Integration systems, create an ANT target and trigger from there.
This section describes a way of triggering suites/scripts from the command line via bat files or shell scripts.
warning
We recommend using the ANT target over using the command line. This section is for backward compatibility.
Playback via testrunner
dangerDEPRECATED:
Use Distributed playback via drun instead.
testrunner.bat
and testrunner.sh
files allow running scripts from the command line.
- Open a command prompt and cd to sahi/userdata/bin (or click on the "Bin" link on the Sahi Dashboard)
- Run testrunner.bat to see the syntax
D:\sahi_pro\userdata\bin>testrunner.bat -- Usage: testrunner <sah file|suite file> <startURL> <browserType|browserDeviceParams> <tags> File path is relative to userdata/scripts Multiple browsers can be specified using +. Eg. ie+firefox browserDeviceParams can be specified as the combinations of StartMode, Browser, AndroidDevice and iOSDevice Eg. "Browser:chrome;AndroidDevice:XXXX;iOSDevice:YYYY;StartMode:BROWSER" tags are used only if the input file is a .s.csv file or a .dd.csv file test cases can be specified in tags argument as "testcases:testcase1,testcase2" -- Example: testrunner.bat sahitests/demo.suite http://sahitest.com/demo/ firefox testrunner.bat sahitests/sahi_demo.sah http://sahitest.com/demo/ ie testrunner.bat sahitests/sahi_demo.sah http://sahitest.com/demo/ ie+firefox testrunner.bat sahitests/demo.dd.csv http://sahitest.com/demo/ firefox "win||all" testrunner.bat sahitests/testcases/testcases_sample.csv http://sahitest.com/demo/ ie "(user||admin)&&medium" testrunner.bat sahitests/ddcsv/test.dd.csv http://sahitest.com/demo/ ie "(user||admin)&&medium" testrunner.bat sahitests/framework/sample.xls http://sahitest.com/demo/training/ ie testrunner.bat sahitests/framework/scenario_new.s.csv http://sahitest.com/demo/training/ ie "all" testrunner.bat sahitests/framework/scenario_sample.s.csv http://sahitest.com/demo/training/ ie "testcases:Check shopping cart total,Test login error message" testrunner.bat script_name.sah http://sahitest.com/demo/ "AndroidDevice:xyz;StartMode:ANDROID" testrunner.bat script_name.sah http://sahitest.com/demo/ "AndroidDevice:xyz;StartMode:ANDROID_BROWSER" testrunner.bat script_name.sah http://sahitest.com/demo/ "iOSDevice:abc;StartMode:IOS" testrunner.bat script_name.sah http://sahitest.com/demo/ "iOSDevice:abc;StartMode:IOS_BROWSER" testrunner.bat script_name.sah http://sahitest.com/demo/ "AndroidDevice:xyz;iOSDevice:abc;StartMode:GENERIC" testrunner.bat script_name.sah http://sahitest.com/demo/ "Browser:chrome;StartMode:WINDOWS" testrunner.bat script_name.sah " " "StartMode:WINDOWS" testrunner.bat script_name.sah " " "StartMode:JAVA" testrunner.bat script_name.sah " " "StartMode:SAP" -- D:\sahi_pro\userdata\bin>
-
Parameters other than suite, startURL and browserType can be modified by editing
testrunner.bat
-
To set the number of parallel browsers to execute the script in, modify
To run in one thread only, ie. to run scripts one after the other sequentially, useSET THREADS=5
SET THREADS=1
-
Sahi normally opens and closes the browser for each script.
To execute all scripts sequentially without closing and reopening browsers, use
SET THREADS=1 SET SINGLE_SESSION=true
-
Sahi, by default, writes logs to the database only.
To force it to write logs to the filesystem, use
html and xml logs will be created in theSET LOGS_INFO=html,xml
sahi/userdata/logs/playback
folder
To force it to write logs to specific file locations, use,SET LOGS_INFO=html:D:/reports/htmllogs/,xml:D:/reports/xmllogs/
Output formats available are html,xml,junit,excel
The format to specify LOGS_INFO isreportType1:filePath1,reportType2,reportType3:filePath3,...
-
When a Sahi suite is run, some scripts may fail because of environment reasons or due to browser crashes.
A natural next step for testers is to verify the failure by running the script again.
Sahi now automatically creates a suite of all failed scripts. The name of the failed suite has
_failed_<browsertype>
appended to the filename. For example if you ran a suiteadmin/admin.suite
on Firefox, failed suite will be created asadmin/admin_failed_firefox.suite
Foradmin/admin.dd.csv
, it will beadmin/admin_failed_firefox.dd.csv
This failed suite file can then be run to verify only the failed testcases. -
Sahi can send out emails at the end of a suite run.
Set the following properties in testrunner.bat file.
Email specific parameters like username, password etc. are defined inSET SEND_EMAIL_REPORT=true SET EMAIL_TRIGGER=success,failure SET EMAIL_PROPERTIES=email.properties SET EMAIL_PASSWORD_HIDDEN=true
sahi/userdata/bin/email.properties
file. -
For a long running suite, Sahi can send periodic emails indicating progress.
To enable periodic emails, set the following property in testrunner.bat file.
SET SEND_EMAIL_REPORT_PERIODICALLY=true
To set time interval (in minutes), set the following property in testrunner.bat file.
SET SEND_EMAIL_REPORT_PERIODICALLY_TIME=30
-
Custom fields can be passed to the scripts using the CUSTOM_FIELDS variable. More than one custom field can be passed. Replace the custom field keys and values as appropriate.
For Windows:
For Linux:SET CUSTOM_FIELDS=-customField customValue -anotherCustomField "another value"
export CUSTOM_FIELDS="-customField customValue -anotherCustomField another value"
info Specifying custom fields is not mandatory. -
Sahi Pro v6.3.0 onwards, a summary of the script playback status is written to the Testrunner console while the script is running. You can read more on Periodic Summary here.
To disable these messages in Windows, set the following property in testrunner.bat file.
For Mac and Linux, you need to set the following property in testrunner.shSET SHOW_PERIODIC_SUMMARY=false
export SHOW_PERIODIC_SUMMARY=false
-
Sahi Pro 9.0.0 onwards, Set value to true to allow scripts to pick element using Sahi auto intelligence when element provided in script is not found. Refer Autoheal section for more details.
For Windows:
For Mac and Linux:SET ISAUTOHEALENABLED=true
export ISAUTOHEALENABLED=true
-
To set the number of parallel browsers to execute the script in, modify
info
Browser names are defined in sahi/userdata/browser-types-xml
testrunner.bat and testrunner.sh use the TestRunner java class internally.
Distributed playback via drun
Sahi Pro can distribute and run tests on multiple machines (nodes). The machine which distributes the scripts and manages the distributed run is referred to as theMaster
. All Dashboard logs are visible from the Master
. The other machines are called Slaves
. Any machine in the distributed environment can serve as the Master
. The machine which launches the distributed run is referred to as the Initiator
.
Sahi provides a couple of batch files - drun.bat
and drun_different_master.bat
(and equivalent shell scripts). They allow running test scripts on multiple machines from the command line.
-
drun.bat
should be used when theMaster
andInitiator
are the same machine. -
drun_different_master.bat
should be used when theMaster
is different from theInitiator
.
danger
Ensure that the same Sahi Pro version has been installed on all the machines participating in the distributed run.
drun
- Sahi distributes the scripts to different machines based on their capacity and availability of browsers. Note that Sahi should be running on each of the nodes. Also, on each machine, the browser paths must be correctly specified.
- Open
sahi_pro/userdata/bin/drun.bat
(drun.sh on linux) using any editor. -
SOURCE_SCRIPTS_PATH points to the folder that contains ALL the scripts to be run. It should be relative to
sahi_pro/userdata
folder OR it should be an absolute path.
For Windows:
For Linux:SET SOURCE_SCRIPTS_PATH=scripts
export SOURCE_SCRIPTS_PATH=scripts
-
Configure the NODES variable to contain all the machines on which the tests should run. The command to set the nodes in Windows and Linux respectively are:
For Windows:
For Linux:SET NODES=localhost:9999,othermachine:9999,thirdmachine:9999
export NODES=localhost:9999,othermachine:9999,thirdmachine:9999
info The nodes may or may not include theMaster
machine (localhost). If theMaster
machine is not included, scripts will not be run on theMaster
.warning "othermachine" and "thirdmachine" are placeholders to illustrate usage. Replace them with actual machine names. The nodes can contain 1 or more machines. -
From Sahi Pro 6.1.0 onwards, it is possible to specify the number of threads that the scripts of the suite would run in.
The number of maximum parallel browsers would be the minimum of two values - threads, and capacity of the browser specified in browser_types.xml.
To set the number of parallel browsers to execute the script in, modify
To run in one thread only, ie. to run scripts one after the other sequentially, useSET THREADS=5
SET THREADS=1
Note that this would affect the number of parallel browsers on each Node. -
When a Sahi suite is run, some scripts may fail because of environment reasons or due to browser crashes.
A natural next step for testers is to verify the failure by running the script again.
Sahi now automatically creates a suite of all failed scripts. The name of the failed suite has
_failed_<browsertype>
appended to the filename. For example if you ran a suiteadmin/admin.suite
in Chrome, failed suite will be created asadmin/admin_failed_chrome.suite
Foradmin/admin.dd.csv
, it will beadmin/admin_failed_chrome.dd.csv
This failed suite file can then be run to verify only the failed scripts. -
Sahi can send a mail summarizing the playback. The variable SEND_EMAIL_REPORT can be set as true or false. If true, Sahi sends the mail.
For Windows:
For Linux:SET SEND_EMAIL_REPORT=true
export SEND_EMAIL_REPORT=true
-
Sahi can send a mail based on success or failure or in both the cases. This condition can be set using the EMAIL_TRIGGER variable.
For Windows:
For Linux:SET EMAIL_TRIGGER=success,failure
export EMAIL_TRIGGER=success,failure
-
For a long running suite, Sahi can send periodic emails indicating progress.
To enable periodic emails, set the following property.
For Windows:
For Linux:SET SEND_EMAIL_REPORT_PERIODICALLY=true
export SEND_EMAIL_REPORT_PERIODICALLY=true
To set time interval (in minutes), use SET SEND_EMAIL_REPORT_PERIODICALLY_TIME variable.
For Windows:
For Linux:SET SEND_EMAIL_REPORT_PERIODICALLY_TIME=30
export SEND_EMAIL_REPORT_PERIODICALLY_TIME=30
- The relative path to the properties file containing information about the mail such as sender, recipient, host, port etc. can be set using the EMAIL_PROPERTIES variable.
- Passwords can be hidden or shown from the console and logs by toggling the EMAIL_PASSWORD_HIDDEN variable. It can be set as true or false. If true, Sahi hides the password from Sahi console and logs.
-
Custom fields can be passed to the scripts using the CUSTOM_FIELDS variable. More than one custom field can be passed. Replace the custom field keys and values as appropriate.
For Windows:
For Linux:SET CUSTOM_FIELDS=-customField customValue -anotherCustomField "another value"
export CUSTOM_FIELDS="-customField customValue -anotherCustomField another value"
info Specifying custom fields is not mandatory. -
The end user can pass a specific id for each suite/script run using the USER_DEFINED_ID variable.
For Windows:
For Linux:SET USER_DEFINED_ID=-userDefinedId "Some Id"
export USER_DEFINED_ID="-userDefinedId Some Id"
Replace the value "Some Id" as appropriate.warning The key should remain as userDefinedId.info Specifying user defined id is not mandatory. -
Sahi can set offline logs to be generated in
xml
,html
,junit
,tm6
andexcel
types. The default type ishtml
.
For Windows:
For Linux:SET LOGS_INFO=xml,html
export LOGS_INFO=xml,html
-
Sahi Pro v6.3.0 onwards, a summary of the script playback status is written to the Drun console while the script is running. You can read more on Periodic Summary here.
To disable these messages in Windows, set the following property in drun.bat file.
For Mac and Linux, you need to set the following property in drun.shSET SHOW_PERIODIC_SUMMARY=false
export SHOW_PERIODIC_SUMMARY=false
-
Sahi Pro 9.0.0 onwards, Set value to true to allow scripts to pick element using Sahi auto intelligence when element provided in script is not found. Refer Autoheal section for more details.
For Windows:
For Mac and Linux:SET ISAUTOHEALENABLED=true
export ISAUTOHEALENABLED=true
- To execute the scripts using drun.bat, open a command window and go to the
<sahi_home>/userdata/bin
directory. This can also be done easily by clicking the bin link on the dashboard. - Run drun.bat to see the syntax.
D:\sahi_pro\userdata\bin>drun.bat -- NOTE: Use this batch file only if you are running it on the Master machine. If you wish to use a different Master, use drun_different_master.bat instead. -- Usage: drun <sah file|suite file> <startURL> <browserType|browserDeviceParams> <tags> File path is relative to userdata/scripts Multiple browsers can be specified using +. Eg. ie+firefox browserDeviceParams can be specified as the combinations of StartMode, Browser, AndroidDevice and iOSDevice Eg. "Browser:chrome;AndroidDevice:XXXX;iOSDevice:YYYY;StartMode:BROWSER" tags are used only if the input file is a .s.csv file or a .dd.csv file test cases can be specified in tags argument as "testcases:testcase1,testcase2" -- Example: drun.bat sahitests/demo.suite http://sahitest.com/demo/ firefox drun.bat sahitests/sahi_demo.sah http://sahitest.com/demo/ ie drun.bat sahitests/sahi_demo.sah http://sahitest.com/demo/ ie+firefox drun.bat sahitests/demo.dd.csv http://sahitest.com/demo/ firefox "win||all" drun.bat sahitests/testcases/testcases_sample.csv http://sahitest.com/demo/ ie "(user||admin)&&medium" drun.bat sahitests/ddcsv/test.dd.csv http://sahitest.com/demo/ ie "(user||admin)&&medium" drun.bat sahitests/framework/sample.xls http://sahitest.com/demo/training/ ie drun.bat sahitests/framework/scenario_new.s.csv http://sahitest.com/demo/training/ ie "all" drun.bat sahitests/framework/scenario_sample.s.csv http://sahitest.com/demo/training/ ie "testcases:Check shopping cart total,Test login error message" drun.bat script_name.sah http://sahitest.com/demo/ "AndroidDevice:xyz;StartMode:ANDROID" drun.bat script_name.sah http://sahitest.com/demo/ "AndroidDevice:xyz;StartMode:ANDROID_BROWSER" drun.bat script_name.sah http://sahitest.com/demo/ "iOSDevice:abc;StartMode:IOS" drun.bat script_name.sah http://sahitest.com/demo/ "iOSDevice:abc;StartMode:IOS_BROWSER" drun.bat script_name.sah http://sahitest.com/demo/ "AndroidDevice:xyz;iOSDevice:abc;StartMode:GENERIC" drun.bat script_name.sah http://sahitest.com/demo/ "Browser:chrome;StartMode:WINDOWS" drun.bat script_name.sah " " "StartMode:WINDOWS" drun.bat script_name.sah " " "StartMode:JAVA" drun.bat script_name.sah " " "StartMode:SAP" -- D:\sahi_pro\userdata\bin>
danger NOTE:  Refer to the Notes below for actual details.In the usage above,- The first argument is the suite or script path. This path can be relative to the path set in SOURCE_SCRIPTS_PATH, or it can be an absolute path contained in SOURCE_SCRIPTS_PATH.
- The second argument is the Start URL.
-
The third argument is the Browser Type.
- Tags (the fourth argument) will be used only when running a scenario file, a data driven suite (.dd.csv) or a CSV as suite with tags. Tags are specified to run specific scripts/testcases from the suite/scenario. eg. If tags are specified as "(user||admin)&&medium", all the scripts which have 'medium' tag and 'admin' or 'user' (or both) tag will be run
drun_different_master
This should be used when theMaster
is different from the Initiator
.
A typical case where you would use this or the ANT equivalent, is when you have a continuous integration build server that is not capable of launching any UI.
The build server will contain all the scripts but since it cannot launch any UI, it cannot run Sahi tests. In such a case, Sahi can be run on other machines and drun_different_master
can be used on the integration build server to trigger the Sahi tests on these machines.
drun_different_master
does the following.
-
It first syncs the contents of scripts folder from the
Initiator
to a staging folder on theMaster
. -
It then distributes the scripts from the staging folder of the
Master
to various nodes and runs the tests. -
If offline logs are requested, the logs are copied over from the
Master
to theInitiator
after the run is over.
drun_different_master
in more detail.
- Sahi (running on the
Master
) distributes the scripts to different machines based on their capacity and availability of browsers. Note that Sahi should be running on each of the nodes. Also, on each machine, the browser paths must be correctly specified.info Sahi does not need to be installed on theInitiator
machine. -
The following directory structure is assumed on the
Initiator
machine. The requisite files like ant-sahi.jar should be copied over from a Sahi Pro installation. The directory structure of the files is the same in the SahiPro installation.<TOP_LEVEL_FOLDER> lib ant-sahi.jar logs userdata bin drun_different_master.bat setjava.bat config email.properties scripts <ALL YOUR SCRIPT FOLDERS AND SCRIPTS>
- Open
<sahi_home>/userdata/bin/drun_different_master.bat
(drun_different_master.sh on linux) using any Editor. - MASTER_HOST should point to the Master machine.
For Windows:
For Linux:SET MASTER_HOST=machine2
export MASTER_HOST=machine2
danger Make sure you change "machine2" to the actual machine name -
INITIATOR_ORIGIN_FOLDER is the path to the base folder containing the various scripts. With the above assumed directory structure, it would point to
<TOP_LEVEL_FOLDER>/userdata/scripts
.info The default value need not be changed. -
MASTER_STAGING_PATH refers to the Staging folder on the Master machine to which the contents of INITIATOR_ORIGIN_FOLDER will be first synced to. Distribution of scripts will happen from MASTER_STAGING_PATH.
info The default value need not be changed.
-
Configure the NODES variable to contain all the machines on which the tests should run. The command to set the nodes in Windows and Linux respectively are:
For Windows:
For Linux:SET NODES=machine2:9999,machine3:9999,machine4:9999
export NODES=machine2:9999,machine3:9999,machine4:9999
info The nodes may or may not include theMaster
machine. If theMaster
machine is not included, scripts will not be run on theMaster
.danger Do not include localhost (theInitiator
) here since Sahi may not be installed on theInitiator
. If you want localhost as one of the nodes, run drun instead.warning "machine2", "machine3" and "machine4" are placeholders to illustrate usage. Replace them with actual machine names. The nodes can contain 1 or more machines. -
From Sahi Pro 6.1.0 onwards, it is possible to specify the number of threads that the scripts of the suite would run in.
The number of maximum parallel browsers would be the minimum of two values - threads, and capacity of the browser specified in browser_types.xml.
To set the number of parallel browsers to execute the script in, modify
To run in one thread only, ie. to run scripts one after the other sequentially, useSET THREADS=5
SET THREADS=1
Note that this would affect the number of parallel browsers on each Node. -
When a Sahi suite is run, some scripts may fail because of environment reasons or due to browser crashes.
A natural next step for testers is to verify the failure by running the script again.
Sahi now automatically creates a suite of all failed scripts. The name of the failed suite has
_failed_<browsertype>
appended to the filename. For example if you ran a suiteadmin/admin.suite
in Chrome, failed suite will be created asadmin/admin_failed_chrome.suite
Foradmin/admin.dd.csv
, it will beadmin/admin_failed_chrome.dd.csv
This failed suite file can then be run to verify only the failed scripts. -
Sahi can send a mail summarizing the playback. The variable SEND_EMAIL_REPORT can be set as true or false. If true, Sahi sends the mail.
For Windows:
For Linux:SET SEND_EMAIL_REPORT=true
export SEND_EMAIL_REPORT=true
-
Sahi can send a mail based on success or failure or in both the cases. This condition can be set using the EMAIL_TRIGGER variable.
For Windows:
For Linux:SET EMAIL_TRIGGER=success,failure
export EMAIL_TRIGGER=success,failure
-
For a long running suite, Sahi can send periodic emails indicating progress.
To enable periodic emails, set the following property.
For Windows:
For Linux:SET SEND_EMAIL_REPORT_PERIODICALLY=true
export SEND_EMAIL_REPORT_PERIODICALLY=true
To set time interval (in minutes), use SET SEND_EMAIL_REPORT_PERIODICALLY_TIME variable.
For Windows:
For Linux:SET SEND_EMAIL_REPORT_PERIODICALLY_TIME=30
export SEND_EMAIL_REPORT_PERIODICALLY_TIME=30
- The relative path to the properties file containing information about the mail such as sender, recipient, host, port etc. can be set using the EMAIL_PROPERTIES variable.
- Passwords can be hidden or shown from the console and logs by toggling the EMAIL_PASSWORD_HIDDEN variable. It can be set as true or false. If true, Sahi hides the password from Sahi console and logs.
-
Custom fields can be passed to the scripts using the CUSTOM_FIELDS variable. More than one custom field can be passed. Replace the custom field keys and values as appropriate.
For Windows:
For Linux:SET CUSTOM_FIELDS=-customField customValue -anotherCustomField "another value"
export CUSTOM_FIELDS=-customField customValue -anotherCustomField "another value"
info Specifying custom fields is not mandatory. -
The end user can pass a specific id for each suite/script run using the USER_DEFINED_ID variable.
For Windows:
For Linux:SET USER_DEFINED_ID=-userDefinedId "Some Id"
export USER_DEFINED_ID=-userDefinedId "Some Id"
Replace the value "Some Id" as appropriate.warning The key should remain as userDefinedId.info Specifying user defined id is not mandatory. -
Sahi can set offline logs to be generated in
xml
,html
,junit
,tm6
andexcel
types. The default type ishtml
. These logs will be generated on theMaster
and pulled back to theInitiator
, since the user would want to see the logs on theInitiator
. The following set of commands illustrate how HTML and XML logs can be generated.
For Windows:
For Linux:SET UNIQUE_ID=%DATE%__%TIME% SET UNIQUE_ID=%UNIQUE_ID: =_% SET UNIQUE_ID=%UNIQUE_ID::=_% SET UNIQUE_ID=%UNIQUE_ID:/=_% SET MASTER_HTMLLOGS_DIR=logs/temp/html/%UNIQUE_ID% SET MASTER_XMLLOGS_DIR=logs/temp/xml/%UNIQUE_ID% SET LOGS_INFO=html:%MASTER_HTMLLOGS_DIR%,xml::%MASTER_XMLLOGS_DIR% SET INITIATOR_OUTPUT_HTMLLOGS_DIR=%TOP_LEVEL_FOLDER%/logs/html/%UNIQUE_ID% SET INITIATOR_OUTPUT_XMLLOGS_DIR=%TOP_LEVEL_FOLDER%/logs/xml/%UNIQUE_ID%
export UNIQUE_ID=$(date +"%m_%d_%Y")__$(date +"%I_%M_%S") export MASTER_HTMLLOGS_DIR=logs/temp/html/$UNIQUE_ID export MASTER_XMLLOGS_DIR=logs/temp/xml/$UNIQUE_ID export LOGS_INFO=html:$MASTER_HTMLLOGS_DIR,xml:$MASTER_XMLLOGS_DIR export INITIATOR_OUTPUT_HTMLLOGS_DIR=$TOP_LEVEL_FOLDER/logs/html/$UNIQUE_ID export INITIATOR_OUTPUT_XMLLOGS_DIR=$TOP_LEVEL_FOLDER/logs/xml/$UNIQUE_ID
info The default values can be left as is. -
Sahi Pro v6.3.0 onwards, a summary of the script playback status is written to the Drun_Diff_Master console while the script is running. You can read more on Periodic Summary here.
To disable these messages in Windows, set the following property in drun_diff_master.bat file.
For Mac and Linux, you need to set the following property in drun_diff_master.shSET SHOW_PERIODIC_SUMMARY=false
export SHOW_PERIODIC_SUMMARY=false
-
Sahi Pro 9.0.0 onwards, Set value to true to allow scripts to pick element using Sahi auto intelligence when element provided in script is not found. Refer Autoheal section for more details..
For Windows:
For Mac and Linux:SET ISAUTOHEALENABLED=true
export ISAUTOHEALENABLED=true
- To execute the scripts using drun_different_master.bat, open a command window and go to the
<sahi_home>/userdata/bin
directory. This can also be done easily by clicking the bin link on the dashboard. - Run drun_different_master.bat to see the syntax.
D:\sahi_pro\userdata\bin>drun_different_master.bat -- NOTE: Use this batch file only if you plan to use a different Master machine. Else, use drun.bat instead. -- Usage: drun_different_master.bat <sah file|suite file> <startURL> <browserType|browserDeviceParams> <tags> File path is relative to userdata/scripts Multiple browsers can be specified using +. Eg. ie+firefox browserDeviceParams can be specified as the combinations of StartMode, Browser, AndroidDevice and iOSDevice Eg. "Browser:chrome;AndroidDevice:XXXX;iOSDevice:YYYY;StartMode:BROWSER" tags are used only if the input file is a .s.csv file or a .dd.csv file test cases can be specified in tags argument as "testcases:testcase1,testcase2" -- Example: drun_different_master.bat sahitests/demo.suite http://sahitest.com/demo/ firefox drun_different_master.bat sahitests/sahi_demo.sah http://sahitest.com/demo/ ie drun_different_master.bat sahitests/sahi_demo.sah http://sahitest.com/demo/ ie+firefox drun_different_master.bat sahitests/testcases/testcases_sample.csv http://sahitest.com/demo/ ie "(user||admin)&&medium" drun_different_master.bat sahitests/ddcsv/test.dd.csv http://sahitest.com/demo/ ie "(user||admin)&&medium" drun_different_master.bat sahitests/framework/sample.xls http://sahitest.com/demo/training/ ie drun_different_master.bat sahitests/framework/scenario_new.s.csv http://sahitest.com/demo/training/ ie "all" drun_different_master.bat sahitests/framework/scenario_sample.s.csv http://sahitest.com/demo/training/ ie "testcases:Check shopping cart total,Test login error message" drun_different_master.bat script_name.sah http://sahitest.com/demo/ "AndroidDevice:xyz;StartMode:ANDROID" drun_different_master.bat script_name.sah http://sahitest.com/demo/ "AndroidDevice:xyz;StartMode:ANDROID_BROWSER" drun_different_master.bat script_name.sah http://sahitest.com/demo/ "iOSDevice:abc;StartMode:IOS" drun_different_master.bat script_name.sah http://sahitest.com/demo/ "iOSDevice:abc;StartMode:IOS_BROWSER" drun_different_master.bat script_name.sah http://sahitest.com/demo/ "AndroidDevice:xyz;iOSDevice:abc;StartMode:GENERIC" drun_different_master.bat script_name.sah http://sahitest.com/demo/ "Browser:chrome;StartMode:WINDOWS" drun_different_master.bat script_name.sah " " "StartMode:WINDOWS" drun_different_master.bat script_name.sah " " "StartMode:JAVA" drun_different_master.bat script_name.sah " " "StartMode:SAP" -- D:\sahi_pro\userdata\bin>
danger NOTE:  Refer to the notes below for actual details.In the usage above,- The first argument is the suite or script path. This path can be relative to the path set in INITIATOR_ORIGIN_FOLDER, or it can be an absolute path contained in INITIATOR_ORIGIN_FOLDER.
- The second argument is the Start URL.
-
The third argument is the Browser Type.
- Tags (the fourth argument) will be used only when running a data driven suite (.dd.csv) or a CSV as suite with tags. Tags are specified to run specific scripts/testcases from the suite. eg. If tags are specified as "(user||admin)&&medium", all the scripts which have 'medium' tag and 'admin' or 'user' (or both) tag will be run.