You can execute a test from the command line using the PsTestFW command.
Enter a text file argument which contains all the parameters in the command line. The text file is deleted immediately after PTF client reads it. You can write the text file manually or it is generated from the Change Assistant during runtime.
The parameters in the file must follow the below guidelines:
• Split the parameter and its value with =.
• Enter each parameter and its value in a new line.
• Enter each parameter and its value in a single line.
For example, your text file will include the following statements.
-CS=<server>:<port>
-ACTION=testrun /*testrun value is used for executing test.*/
-PFX=
-EXO=<ExecutionOptions>
-LOG=<logfile name>.log
Syntax
Use the following syntax to execute the test using a text file argument.
''<Path>\PsTestFw.exe'' ''C:\temp\ptf_cmd_param.txt''
Use the following syntax to execute a test using the existing environment connection:
PsTestFw -CD=ConnectionName -CP=ConnectionPassword -TST=TestName
-TC=TestCaseName [-TL=Line X(integer)][-PFX=Prefix] -EXO=ExecutionOption [-LOG=Log⇒
FileName][-ACTION=testrun]
Use the following syntax to execute a test using specified environment connection parameters:
PsTestFw -CS=Server -CNO=NodeName -PS=ProxyServer -PU=ProxyUser -PP=ProxyPassword -CO=UserName -CP=ConnectionPassword -TST=TestName -TC=TestCaseName [-TL=Line X(int⇒
eger)]
[-ACTION=testrun] [-PFX=Prefix] -EXO=ExecutionOption [-LOG=LogFileName]
Parameters
–CD= Specify the name of the environment login to use for
connection. This is the Database Name you would select in the
PeopleSoft Test Framework Signon dialog box when signing on to PTF.
The environment login settings are stored in the environments.
xml file in the PTF data directory (C:\Documents and Settings\<User>\Application Data\PeopleSoft
\PeopleSoft Test Framework by default). If the environment connection data is not set in the environments.xml file, then you can explicitly specify the connection parameters.
See the following table for a description of connection parameters.
See Creating a Connection to a PTF Environment.
–CUA= (Optional) Action on the SSL error. Values are:
• True– Continue with unsecured connection.
• False– Cancel the login.
–CP= Specify the user password.
–TST= Specify the test name.
–TC= Specify the test case name.
–TL= (Optional) Specify the line number from which to start the test.
–PFX= (Optional) Specify the prefix.
See #PREFIX#
–EXO= Specify the execution option to be used in the execution.
Note: The name of the execution option must not contain the following characters:
space & ? / \ * < > ' "
–ACTION= (Optional) action type. For test execution, the value is testrun.
–LOG= (Optional) Specify the name for the log. The default is
unattended.log.
-SOE= (Optional) Stops execution if the test encounters an error.
See Using the Test Editor
-LBO= (Optional) Keeps the PTF-launched browser window open after
executing a test, to assist with debugging.
See Using the Test Editor
If you do not use the -CD= parameter to specify the connection data, use the parameters in the following table:
–CS= Specify the server:port to connect to. This is the Server:Port value you would enter in the PeopleSoft Test Framework Signon dialog box when signing on to PTF.
–CNO= Specify the node name.
–CO= Specify the user name.
–PS= (Optional) Specify the ProxyServer:Port.
–PU= (Optional) Specify the proxy user. If you use network
authentication, use the DOMAIN\USER format.
–PP= (Optional) Specify the proxy password.
–ACTION= (Optional) action type. For test execution, the value is testrun.
Example
The following example uses the –CD= parameter to set connection parameters:
PsTestFw -CD=QE851 -CP=password -TST=TEST_CMD_LINE -TC=DEFAULT -PFX=Prefix
-EXO=QE851_No_Folder -LOG=my_run_log -ACTION=testrun /*The -ACTION parameter is opt⇒
ional*/
The following example explicitly sets connection parameters:
PsTestFw -CS=rtdc79637vmc:8643 -CNO=PT_LOCAL -PS=ProxyServer:2345
-PU=mydomain\username -PP=pwd123 -CO=username -CP=password -TST=TEST_CMD_LINE
-TC=DEFAULT -PFX=Prefix -EXO=QE851_No_Folder -LOG=my_run_log -ACTION=testrun /*The ⇒ -ACTION parameter is optional*/
Log File
The execution will generate an output log file in the PTF data directory (C:\Documents and Settings\<user>\Application Data\PeopleSoft\PeopleSoft Test Framework by default).
If the log file exists it will be overwritten.
This is an example of a log file:
<execution>
<Started>2014-06-18 04:41:46</Started>
<Param>
<Database>L921PDVL</Database>
<TestName>DR_DUMMY_SHELL</TestName>
<TestCase>DEFAULT</TestCase>
<ExecOpt>L921PDVL</ExecOpt>
</Param>
<Status>Failed</Status>
<Test>
<Exec1>
<Name>DR_DUMMY_LOOP</Name>
<Case>DEFAULT</Case>
<LogLine15>case is not DEFAULT2</LogLine15>
<LogLine16>Execution stopped by Execution.Stop_On_Error: 6/18/2014 4:41:54 PM⇒
</LogLine16>
<Status>Failed</Status>
</Exec1>
<Exec2>
<Name>DR_DUMMY_LOOP</Name>
<Case>DEFAULT2</Case>
<Status>Passed</Status>
</Exec2>
<Exec3>
<Name>DR_DUMMY_LOOP</Name>
<Case>DEFAULT3</Case>
<LogLine44>case is not DEFAULT2</LogLine44>
<LogLine45>Execution stopped by Execution.Stop_On_Error: 6/18/2014 4:41:55 PM⇒
</LogLine45>
<Status>Failed</Status>
</Exec3>
<LogFolder>TEST</LogFolder>
<LogName>4. PS 2014-06-18 16:41</LogName>
<Message>Execution stopped by Execution.Stop_On_Error: 6/18/2014 4:41:55 PM</Me⇒
ssage>
</Test>
</execution>
Return Code Option For PTF Command Line Execution
PTF returns an integer value representing the relative success of the execution, when called from the command line. The integer value is captured by the calling program.
Sample syntax for capturing PTF's integer return value (into a variable in a sample batch file called iRetCode) might be coded as follows:
start /w /MIN PsTestFw -CS=<Environment_server_port> -CNO=<optional_Environment_Nod⇒
e_ID> -CO=<Environment_User_ID> -CP=<Environment_User_Password> -TST=<ShellTest_Nam⇒
e> -TC=<Test Case Name> -EXO=<Execution_options> -LOG=C:\Temp\LOG1.xml set iRetCode⇒
=%errorlevel% echo %iRetCode%