Executing Tests

This section describes how to execute tests and test cases.

To execute a test:

  1. With a test open in PTF, select Test, Run.

    Alternatively, you can press F5 or click the Run button.

  2. If Yes is specified in the Prompt for Options field for the default execution option, then the Execution Options dialog box appears.

    Select an execution option from the list and click Accept.

    PTF opens the PeopleSoft application specified in Execution Options and executes the steps in the test.

  3. After the test executes, PTF opens the test log in the Log Viewer.

Note: When PTF executes a test it disables Num Lock and Caps Lock on your keyboard and restores them when the test completes. If the execution terminates abnormally, the test does not complete, or hangs up, and PTF does not restore Num Lock and Caps Lock. Select Test, End or click the End icon in the toolbar to end the test and restore Num Lock and Caps Lock. Also, you should not press the Caps Lock or Num Lock keys during test execution; if you do, subsequent test steps may fail. Also, you should not press the Caps Lock or Num Lock keys, during test execution; if you do, subsequent test steps may fail.

To execute a test case:

  1. With a test open in PTF, select a test case from the Test Case drop-down list.

    If you do not select a test case, the system uses the DEFAULT test case.

    Alternatively, you can open a test case from PTF Explorer.

  2. Select Test, Run.

  3. Review the log in the Log Viewer.

You can start execution from a specific step using the Run from Step option in the Test menu.

Important! You are responsible for completing any required preceding steps when executing a test using the Run from Step command, such as Browser.Frameset, assigning variables, and hooking the browser, for example.

To execute a test from a specific step:

  1. With a test open in PTF, select Test, Run from Step.

    Alternatively, you can press F6.

  2. In the Run from Step dialog box, enter or select the step sequence number from which to begin test execution, and click OK.

    If the specified sequence number does not exist, test execution begins at either the next highest sequence number, or the last test step sequence, whichever is the lower value.

    If the specified sequence number is an inactive step, then test execution begins with the next highest sequence number.

  3. After the test executes, PTF opens the test log in the Log Viewer.

    The log file will include information about which step the test was started from.

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>
-CUA=TRUE
-CO=<userID> 
-CP=<password>
-TST=<TestNameFile>
-TC=DEFAULT
-PFX=
-EXO=<ExecutionOptions>
-LOG=<logfile name>.log

Syntax

Use the following syntax to login using a text file argument.

''<Path>\PsTestFw.exe'' ''C:\temp\ptf_cmd_param.txt''

Use this 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=LogFileName]

Use this 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(integer)]
[-PFX=Prefix] -EXO=ExecutionOption [-LOG=LogFileName]

Parameters

Field or Control

Definition

–CD=

Specify the name of the environment signon 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 signon 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.

–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 & ? / \ * < > ' "

–LOG=

(Optional) Specify the name for the log. The default is unattended.log.

If you do not use the -CD= parameter to specify the connection data, use the parameters in the following table:

Field or Control

Definition

–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.

Example

The following example uses the –CD= parameter to set connection parameters:

PsTestFw -CD=QE851 -CP=VP1 -TST=TEST_CMD_LINE -TC=DEFAULT -PFX=Prefix 
-EXO=QE851_No_Folder -LOG=my_run_log

The following example explicitly sets connection parameters:

PsTestFw -CS=rtdc79637vmc:8643 -CNO=PT_LOCAL -PS=ProxyServer:2345 
-PU=mydomain\username -PP=pwd123 -CO=VP1 -CP=VP1 -TST=TEST_CMD_LINE 
-TC=DEFAULT -PFX=Prefix -EXO=QE851_No_Folder -LOG=my_run_log

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</Message>
  </Test>
</execution>

Return Code Option For PTF Command Line Execution

The iRetCode command returns the status of test execution from the command line.

The syntax for this command is:

iRetCode= PsTestFw -CS=<Environment_server_port> -CNO=<optional_Environment_Node_ID>
 -CO=<Environment_User_ID> -CP=<Environment_User_Password> -TST=<ShellTest_Name>
 -TC=<Test Case Name> -EXO=<Execution_options> -LOG=C:\Temp\LOG1.xml

Return values are:

Field or Control

Definition

-1

Failed

-2

Not Completed-FatalError

0

Passed

-3

Starting

-10

Else