C Command Line Reference

This appendix lists the parameters for running Oracle Load Testing scenarios from the command line.

To run Oracle Load Testing scenarios from the command line, type:

[OATS Install Dir]/jdk/bin/java -jar OLTCommandLine.jar -command -option=value -option=value [...]

-option may consist of any number of Oracle Load Testing command line settings. Required arguments are specified based upon the command and are case-insensitive unless otherwise specified.

C.1 Specifying Command Line Settings

This section describes how to use the command line settings.

  • Command line settings may be specified using the following format:

    OLTCommandLine.jar -command -option=value [...]

    Example 1: Run a scenario and log the results to a file.

    cd C:/[OATS Install Dir]/lib
    [OATS Install Dir]/jdk/bin/java -jar OLTCommandLine.jar -run -scenarioFile="C:/OracleATS/OFT/Simple Scenario.scn" -OLTServer=localhost:8088 -user=oats -password=mypass123 -log=C:/OracleATS/OFT/mylog.log
    

    Example 2: Run a scenario with rampup of 2 Users every 30 seconds.

    cd C:/[OATS Install Dir]/lib
    [OATS Install Dir]/jdk/bin/java -jar OLTCommandLine.jar -run -scenarioFile="c:/oracleats/OFT/Simple Scenario.scn" -session=TestSession -OLTServer=localhost:8088 -user=oats -password=mypass123 -iteration=1 -groupdatanumber=2 -ramptriggerafterseconds=30
    

    Example 3: Run a scenario with rampup of 2 Users every 2 iterations.

    cd C:/[OATS Install Dir]/lib
    [OATS Install Dir]/jdk/bin/java -jar OLTCommandLine.jar -run -scenarioFile="c:/oracleats/OFT/Simple Scenario.scn" -session=TestSession -OLTServer=localhost:8088 -user=oats -password=mypass123 -groupdatanumber=2 -ramptriggerafteriterations=2
    

    Example 4: Get the Oracle Load Testing version.

    cd C:/[OATS Install Dir]/lib
    [OATS Install Dir]/jdk/bin/java -jar OLTCommandLine.jar -version -OLTServer=localhost:8088 -user=oats -password=mypass123
    

    Example 5: Stop Session0001.

    cd C:/[OATS Install Dir]/lib
    [OATS Install Dir]/jdk/bin/java -jar OLTCommandLine.jar -stop -session="Session0001" -OLTServer=localhost:8088 -user=oats -password=mypass123
    

    Example 6: Generate Session Report.

    cd C:/[OATS Install Dir]/lib
    [OATS Install Dir]/jdk/bin/java -jar OLTCommandLine.jar -report -OLTServer=localhost:8088 -user=oats -password=mypass123 -session=mysession001 -thinkTime=false -filterDateMin="3/19/2013 08:00:00" -filterDateMax="3/19/2013 15:30:00" -log= C:/OracleATS/OFT/Default/mylog.log -localFile=c:/myreport.htm
    
  • If many settings are required, use the -property setting to specify a file containing a larger number of properties. See the -property setting in the Run Settings for additional information.

C.1.1 Error Handling

If the OLT server is not running, an error will occur.

If the scenario file does not exist, an error will occur.

If the scenario file is not a correct xml, an error will occur.

C.2 Supported Command Line Settings

This section lists the command line settings that can be used with Oracle Load Testing.

C.2.1 Commands

The following table lists commands used for Oracle Load Testing command line execution. The options include the General Settings and any command-specific additional options.

Command Description
-addagent -[options] Adds an Oracle Load Testing agent using the specified options. You can verify that the agent is been added to the systems manager by selecting Options from the User menu then selecting VU Agent Systems in the Systems group. See the AddAgent Settings for additional options.

Example usage:

cd /OracleATS/lib

c:/OracleATS/jdk/bin/java -jar OLTCommandLine.jar -addagent -agentname=Cloud_Agent1 -agenthostnameorip=mysystem.example.com -agentpassword=mypass123 -OLTServer=localhost:8088 -user=oats -password=mypass123

c:/OracleATS/jdk/bin/java -jar OLTCommandLine.jar -importandrun -scenarioFile="Path_of_scenariozip" -OLTServer=localhost:8088 -user=oats -password=mypass123 -repository=Default -target=Cloud_Agent1 -session=mysessionname

-addagentgroup -[options] Adds an Oracle Load Testing agent group using the specified options. You can verify that the agent group has been added to the systems manager by selecting Options from the User menu then selecting VU Agent Systems in the Systems group. See the AddAgentGroup Settings for additional options.

Example usage:

cd /OracleATS/lib

c:/OracleATS/jdk/bin/java -jar OLTCommandLine.jar -addagentgroup -agentgroupname=myagentgroup -systems="agent1;agent2" -OLTServer= localhost:8088 -user=oats –password=mypass123

-getdbconfig -[options] Gets the database configuration information. username is the db username ('sysman' by default) & password is the database password. OLTServer may be any machine that has the Oracle Load Testing controller installed. This command returns the currently configured database-related information in XML format, for example:

<DBConfig name="Default OLT Database"><description>description text</description><DBConnect type="Oracle" string="jdbc:oracle:thin:@//localhost:1521/XE" acct="OLT"></DBConnect></DBConfig>

Example usage:

cd /OracleATS/lib

c:/OracleATS/jdk/bin/java -jar OLTCommandLine.jar -getdbconfig –OLTServer= localhost:8088 -user=oats -password=mypass123

-export -[options] Exports the specified scenario to a scenario .scnzip file. See the Export and Import Settings for additional options.

Example usage:

cd /OracleATS/lib

c:/OracleATS/jdk/bin/java -jar OLTCommandLine.jar export -scenarioFile=c:/OracleATS/OFT/myTest.scn -OLTServer=localhost:8088 -user=oats -password=mypass123 -repository=Default -workspace=myfolder

-import -[options] Imports the specified scenario .scnzip file. See the Export and Import Settings for additional options.

Example usage:

cd /OracleATS/lib

c:/OracleATS/jdk/bin/java -jar OLTCommandLine.jar -import -OLTServer=localhost:8088 -user=oats -password=mypass123 -repository=Default -scenarioFile=c:/OracleATS/OFT/myTest.scnzip

-importandrun -[options] Imports the specified scenario .scnzip file and runs the scenario.

Example usage:

cd /OracleATS/lib

c:/OracleATS/jdk/bin/java -jar OLTCommandLine.jar -importandrun -scenarioFile=c:/OracleATS/myTest.scnzip -OLTServer=localhost:8088 -user=oats -password=mypass123 -repository=Default

-report -[options] Generates a session report for the specified session. See the Report Settings for additional options.

Example usage:

cd /OracleATS/lib

c:/OracleATS/jdk/bin/java -jar OLTCommandLine.jar -report -OLTServer=localhost:8088 -user=oats -password=mypass123 -session=mysession001 -thinkTime=false -filterDateMin="3/19/2013 08:00:00" -filterDateMax="3/19/2013 15:30:00" -log= C:/OracleATS/OFT/Default/mylog.log -localFile=c:/myreport.htm

-run -[options] Runs the selected scenario until the command line stop command is issued, the specified command line stopat condition is reached, or the stop conditions specified in the scenario are reached. See the Run Settings for additional options.

Example usage:

cd /OracleATS/lib

c:/OracleATS/jdk/bin/java -jar OLTCommandLine.jar -run -scenarioFile="C:/OracleATS/OFT/Default/myTest.scn" -OLTServer=localhost:8088 -user=oats -password=mypass123 -log= C:/OracleATS/OFT/Default/mylog.log

-status -[options] Returns the current Oracle Load Testing session status in the following format:

-1: session not found

0: session complete

1: session running

Example usage:

cd /OracleATS/lib

c:/OracleATS/jdk/bin/java -jar OLTCommandLine.jar -status -OLTServer=localhost:8088 -user=oats -password=mypass123 -session=mySession

-stop -[options] Shuts down the specified session. The Stop command is not required if the specified Scenario being run has a Stop condition of some defined time or number of iterations saved in the Ramp settings. You can not use both "-Run" and "-Stop" in the same command. See the Stop Settings for additional options.

Example usage:

cd /OracleATS/lib

c:/OracleATS/jdk/bin/java -jar OLTCommandLine.jar -stop -session="SESSION0001" -OLTServer=localhost:8088 -user=oats -password=mypass123

-version -[options] Gets the current Oracle Load Testing version in XML format, for example:

OLT Version is <OLTVersion version="xx.x.x.x.xxx"></OLTVersion>

Example usage:

cd /OracleATS/lib

c:/OracleATS/jdk/bin/java -jar OLTCommandLine.jar -version -OLTServer=localhost:8088 -user=oats -password=mypass123


C.2.2 General Settings

The following table lists the command line settings used for all commands.

Setting Description
-OLTServer=servername:port Specify the name and port number of the Oracle Load Testing server. The default port is 8088.

Example usage:

-OLTServer=localhost:8088

-user=oats Specify the user name for the Oracle Load Testing server. The required username is "oats".

Example usage:

-user=oats

-password=password Specify the password. The password is the password defined during the Oracle Application Testing Suite installation process.

Example usage:

-password=mypass123


C.2.3 AddAgent Settings

The following table lists the AddAgent command line settings. These settings are used in addition to the General Settings.

Setting Description
-agentname=agentname Specify the name of the Oracle Load Testing agent.

Example usage:

-agentname=Cloud_agent1

-agenthostnameorip=nameorIp Specify the host name or IP address of the Oracle Load Testing agent.

Example usage:

-agenthostnameorip=mysystem.example.com

-agentpassword=password Specify the password to use for the Oracle Load Testing agent.

Example usage:

-agentpassword=mypass123


C.2.4 AddAgentGroup Settings

The following table lists the AddAgentGroup command line settings. These settings are used in addition to the General Settings.

Setting Description
-agentgroupname=name Specify a name for the Oracle Load Testing agent group.

Example usage:

-agentgroupname=myagentgroup

-systems=name1;name2;name_n Specify the names of the Oracle Load Testing agents. Agents names are separated by semi-colon (;) in the -systems option.

Example usage:

-systems="agent1;agent2"


C.2.5 Export and Import Settings

The following table lists the import and export command line settings. These settings are used in addition to the General Settings.

Setting Description
-localFile=localFile (Export only.) Specify a name to use for the exported Oracle Load Testing scenario file.

Example usage:

-localFile=myFile.scnzip

-log=logfile Optional. Specify the path and file name of a log file.

Example usage:

-log=c:/OracleATS/OFT/mylog.txt

-repository=repositoryName Specify a name for the Oracle Load Testing repository.

Example usage:

-repository=Default

-scenarioFile=scenarioFile Specify the path and name of the Oracle Load Testing scenario (.scn) file to import or export.

Example usage:

-scenarioFile="c:/OracleATS/OFT/Default/test1.scn"

-workspace=workspaceName Optional. Specify a name for an Oracle Load Testing workspace folder.

Example usage:

-workspace=myFolder


C.2.6 Report Settings

The following table lists the Report command line settings. These settings are used in addition to the General Settings.

Setting Description
-localFile=localFile Specify a name to use for the generated Oracle Load Testing session report.

Example usage:

-localFile=mySessionReport.html

-log=logfile Optional. Specify the path and file name of a log file.

Example usage:

-log=c:/OracleATS/OFT/mylog.txt

-session=sessionName Specify the name of the session to use to generate the report.

Example usage:

-session=mysession001

-thinkTime=true|false Optional. Specify if think times are included in the session report. When true, only Server Times are included in the report. When false, End-to-End Times are included in the report (includes "Think Times"). The default is true.

Example usage:

-thinkTime=false

-filterDateMin=M/d/yyyy HH:mm:ss Optional. Specify the minimum date to use to filter the report data.

Example usage:

-filterDateMin="3/19/2013 08:00:00"

-filterDateMax=M/d/yyyy HH:mm:ss Optional. Specify the maximum date to use to filter the report data.

Example usage:

-filterDateMax="3/19/2013 015:30:00"


C.2.7 Run Settings

The following table lists the Report command line settings. These settings are used in addition to the General Settings.

Setting Description
-property=propertyFile Specify the file path to a properties file listing only the command line -user and -password arguments in name=value pair format.

The format in the property file is:

name=value

For example:

user=oats

password=mypass123

Example usage:

-property=c:/OLTRun.properties
-scenarioFile=scenarioFile Specify the path and name of the Oracle Load Testing scenario (.scn) file to run.

Example usage:

-scenarioFile="c:/OracleATS/OFT/Default/test1.scn"

-session=sessionName Optional. Specify a name to use for the Oracle Load Testing session. If not specified, a session name is automatically assigned. Session names that are automatically assigned can be located on the console or in the log file specified using the -log option.

Example usage:

-session=MySession001

-log=logfile Optional. Specify the path and file name of a log file.

Example usage:

-log=c:/OracleATS/OFT/mylog.txt

-useCloud Required if using a Cloud agent. Indicates the Oracle Load Testing scenario will be run on an Oracle Enterprise Manager Cloud. Specify the additional required and optional cloud run settings.

Example usage:

-useCloud

-cloudEmHost=EM Host Required if using a Cloud agent. Specify the name of the Oracle Enterprise Manager Cloud host machine.

Example usage:

-cloudEmHost=mycloud.example.com

-cloudEmPort=EM Port Required if using a Cloud agent. Specify the port used for the Oracle Enterprise Manager Cloud.

Example usage:

-cloudEmPort=17061

-cloudEmUsername=EM Username Required if using a Cloud agent. Specify the user name used for the Oracle Enterprise Manager Cloud.

Example usage:

-cloudEmUsername=myEMusername

-cloudEmPassword=EM Password Required if using a Cloud agent. Specify the password used for the Oracle Enterprise Manager Cloud.

Example usage:

-cloudEmPassword=myEMpassword

-cloudAssembly=Assembly Name Required if using a Cloud agent. Specify the assembly name used for the Oracle Enterprise Manager Cloud.

Example usage:

-cloudAssembly=assemblyName

-cloudZone=Zone Name Required if using a Cloud agent. Specify the zone name used for the Oracle Enterprise Manager Cloud.

Example usage:

-cloudZone=zoneName

-cloudPlan=DeploymentPlan Required if using a Cloud agent. Specify the deployment plan used for the Oracle Enterprise Manager Cloud.

Example usage:

-cloudPlan=myDelpoymentPlanName

-cloudNetwork=Network Name Required if using a Cloud agent. Specify the network name used for the Oracle Enterprise Manager Cloud.

Example usage:

-cloudNetwork=myNetworkName

-cloudInitial=Initial Agent Count Optional if using a Cloud agent. Specify the initial agent count to use when running scenarios in the Oracle Enterprise Manager Cloud. The default is 3.

Example usage:

-cloudInitial=2

-cloudMinimum=Minimum Free Agent Count Optional if using a Cloud agent. Specify the minimum free agent count to use when running scenarios in the Oracle Enterprise Manager Cloud. The default is 0.

Example usage:

-cloudMinimum=1

-cloudMaximum=Maximum Free Agent Count Optional if using a Cloud agent. Specify the maximum free agent count to use when running scenarios in the Oracle Enterprise Manager Cloud. The default is 10.

Example usage:

-cloudMaximum=5

-cloudIncrement=Cloud Agent Increment Optional if using a Cloud agent. Specify the agent increment to use when running scenarios in the Oracle Enterprise Manager Cloud. The default is 2.

Example usage:

-cloudIncrement=1

-cloudPrefix=Agent Prefix Optional if using a Cloud agent. Specify the agent prefix string to use when running scenarios in the Oracle Enterprise Manager Cloud. The default is "OLT".

Example usage:

-cloudPrefix=myOLT

-cloudSystemCpuMax=System CPU threshold Optional if using a Cloud agent. Specify the percentage of CPU to use as the agent threshold when running scenarios in the Oracle Enterprise Manager Cloud. The default is 70%.

Example usage:

-cloudSystemCpuMax=65

-cloudSystemMemFreeMin=System Free Memory threshold Optional if using a Cloud agent. Specify the amount of free memory to use as the agent threshold when running scenarios in the Oracle Enterprise Manager Cloud. The default is 200MB.

Example usage:

-cloudSystemMemFreeMin=195

-groupdatapercent=% users Optional. Specify the percentage of Virtual Users to rampup on the rampup trigger when running scenarios. Used with a ramptriggerafter setting.

Example usage:

-groupdatapercent=5

-groupdatanumber=# users Optional. Specify the number of Virtual Users to rampup on the rampup trigger when running scenarios. Used with a ramptriggerafter setting.

Example usage:

-groupdatanumber=2

-iteration=# iterations Optional. Specify the number of iterations to run when running scenarios.

Example usage:

-iteration=2

-ramptriggerafteriterations=# iterations Optional. Specify the number of iterations to use as the VU rampup trigger when running scenarios. Used with the iteration setting.

Example usage:

-ramptriggerafteriterations=2

-ramptriggerafterseconds=# seconds Optional. Specify the number of seconds to use as the VU rampup trigger when running scenarios. Used with a groupdata setting.

Example usage:

-ramptriggerafterseconds=2

-ReplaceURLs=urlA=urlB Optional. Specify the URLs to replace within scripts when running scenarios.

Example usage:

-ReplaceURLs=abc:7011=def:7011

-stopatdelay=# seconds Optional. Specify the number of seconds to run when running scenarios. This setting overrides any stop controls defined in the scenario file.

Example usage:

-stopatdelay=500

-stopattime=hh:mm:ss Optional. Specify the hour, minute, and second to use as the stop time when running scenarios. This setting overrides any stop controls defined in the scenario file.

Example usage:

-stopattime=10:30:00

-scriptname

-scriptname[.target=target]

-scriptname[.VUCount=count]

Optional. Specify a script within a scenario to run. Optionally specify the target agent to use for the specified script(s) and/or the Virtual User count for the specified script(s) when running scenarios. Use double quotation marks if spaces are used the script name.

If target is not specified, Oracle Load Testing will use the target agents(s) saved in the scenario file.

VUCount is case sensitive. If VUCount is not specified, Oracle Load Testing will use the VU count(s) saved in the scenario file.

Example usages:

-SimpleTest

-SimpleTest.VUCount=5

-"Simple Test".target=Cloud_Agent

-"Simple Test".VUCount=2

-target=target Optional. Specify the target agent to use when running scenarios. The target agent will be applied to all scripts in the scenario.

Example usage:

-target=OLTServer

-VUCount=count Optional. Specify the Virtual User count to use when running scenarios. The Virtual User count will be applied to all scripts in the scenario. VUCount is case sensitive.

Example usage:

-VUCount=10


C.2.8 Status Settings

The following table lists the Status command line settings. These settings are used in addition to the General Settings.

Setting Description
-session=sessionName Specify the name of the session. If not specified, the status of the currently running session is returned in the following format:

-1: session not found

0: session complete

1: session running

Example usage:

-session=Session0001


C.2.9 Stop Settings

The following table lists the Stop command line settings. These settings are used in addition to the General Settings.

Setting Description
-log=logfile Optional. Specify the path and file name of a log file.

Example usage:

-log=c:/OracleATS/OFT/mylog.txt

-session=sessionName Optional. Specify the name of the session to stop. If not specified, the currently running session is stopped.

Example usage:

-session=Session0001