This chapter discusses how to:
Create tests.
Record tests.
Create test cases.
Execute tests.
Review test logs.
This section discusses how to:
Create a new folder.
Create a new test.
Name tests.
Copy a test.
Each test, along with the related test cases and logs, is stored in a folder in the PTF Explorer tree structure.
To create a new folder:
In PTF Explorer, highlight the folder in which you want to create the new folder or highlight Home to create the folder at the root level.
Select Create, Folder.
Enter a new folder name.
Click OK.
Note. Folder names must not contain the following characters:
& ? / \ * < > ' "
To create a new test:
Highlight a folder in PTF Explorer.
Select Create, Test.
The Test Editor launches with a new test.
(Optional) In the Test Descr field, enter a description for the test case.
(Optional) Click the Prop button to enter a long description of the test case.
It is a good practice to provide a good description for a test, such as a description of the product, feature, or business process being tested. Test names are often short and provide little information.
Select Test, Save or click the Save button in the toolbar.
Enter a name for the new test.
Click OK.
These rules apply to test names:
Test names and test case names can consist of letters, numbers, and underscores, but they must begin with a letter.
PeopleSoft Test Framework (PTF) converts test names and test case names to uppercase.
Two tests in the same database instance must not have the same name, even if they reside in different folders.
Because PTF data resides in the application database, conflicts may occur if PTF users or administrators attempt to copy tests or test cases from one database to another database containing tests or test cases with the same name.
To copy a test:
Highlight a test in the PTF Explorer.
Select Edit, Copy or press CTRL-C to copy the test.
Highlight the folder where the test is to be located.
Select Edit, Paste or press CTRL-V to paste the test.
Enter a name for the new test.
When you copy and paste a test the test cases are copied as well, but not the logs. When you cut and paste a test the logs are moved also.
When you record a test, PTF monitors each action you perform in the target application and creates a corresponding step in the test.
PTF Recorder populates these fields for each step:
Seq
ID
Active
Scroll ID is populated manually by the developer.
Type
Action
Recognition
Value
This is an example of test steps:
Seq and ID are system-generated fields.
Scroll ID is populated by the developer only for scroll actions.
Recognition and Value are not used with some actions, such as Browser.Start or Page.Save.
For a complete description of test steps, see “Test Step Fields.”
See Test Step Fields.
See Also
To record a test:
Create a new test or open an existing test.
If you are recording within an existing test, highlight a test step. The system inserts the steps in the new recording following the highlighted step. If you are recording a new test, recording begins at Step 2. Step 1 is always Browser.Start or Browser.Start_Login. For an explanation of the difference between Start and Start_Login, see “PTF Test Language Reference.”
See Browser.
With a test open, select Test, Open Test Recorder or click the Show Test Recorder button in the toolbar.
The Recorder toolbar appears.
Hook a browser, that is, associate a PeopleSoft application browser with the test.
To hook a browser, you can either:
Click the Start Web Client button on the recorder toolbar. This will start the web browser with the default test application URL.
Select a browser window with the test application open and hook the application by dragging the Select Browser icon to the browser window.
Note. PTF will only hook a browser that was originally launched by PTF.
Click the Start Recording button in the Recorder toolbar to begin recording.
Perform the test steps in the PeopleSoft application.
Click the Stop Recording button in the Recorder toolbar to end the recording.
Save the test.
Often, you will want to run the same test multiple times using different values in the Value column. Test cases enable you to associate different sets of data with a test. You can view and edit both the test and test case in a single unified window.
To create a new test case:
With a test open, click the New button to the right of the Test Case field.
Enter a name for the new test case.
(Optional) In the Test Case Descr field, enter a description for the test case.
(Optional) Click the Prop button to enter a long description of the test case.
It is a good practice to provide a good description for a test case. Test case names are often short and provide the user with little information.
The new test case provides a set of new, empty Value fields for all the steps of the test.
Enter a new value for each step that requires a value.
Save the test case.
This example shows a new test case with blank values:
For convenience, you may want to create a test case with the Value column populated with the values from the original test or from another test case. Then, you can edit the values in the new test case.
Note. The test case associated with the original test is named DEFAULT. Every test has one test case named DEFAULT.
You can select an existing test case from the Test Case drop-down list box.
PTF displays the number of test cases associated with the test, including the DEFAULT test case, next to the Test Case field label.
To create a test case with values:
With a test case open, select Test, Test Case Save As.
Enter a name for the new test case.
(Optional) Enter a short description and a long description for the test case.
Highlight each value you want to change and enter a new value.
Save.
This section describes how to execute tests and test cases.
To execute a test:
With a test open in PTF, select Test, Run.
Alternatively, you can press F5 or click the Run button.
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.
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.
See Also
To execute a test case:
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.
Select Test, Run.
Review the log in the Log Viewer.
See Also
You can also execute a test from the command line.
Syntax
Use this syntax to execute a test using existing environment connection:
PsTestFw -CD=ConnectionName -CP=ConnectionPassword -TST=TestName -TC=TestCaseName [-PFX=Prefix] -EXO=ExecutionOption [-LOG=LogFileName]
Use this syntax to explicitly specify connection parameters:
PsTestFw -CD=ConnectionName -CP=ConnectionPassword -TST=TestName -TC=TestCaseName [-PFX=Prefix] -EXO=ExecutionOption [-LOG=LogFileName]
Parameters
Parameter |
Description |
–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, the you can explicitly specify the connection parameters. See the following table for a description of connection parameters. |
–CP= |
Specify the user password. |
–TST= |
Specify the test name. |
–TC= |
Specify the test case name. |
–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: |
–LOG= |
(Optional) Specify the name for the log file. 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:
Parameter |
Description |
–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. If you use network authentication, user the DOMAIN\USER format. |
–PS= |
Specify the ProxyServer:Port. |
–PU= |
Specify the proxy user. |
–PP= |
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=rtdc796vmc:443 -CNO=PT_LOCAL -CO=VP1 -CP=VP1 -TST=TEST_CMD_LINE -TC=DEFAULT -PFX=Prefix -EXO=QE851_No_Folder -PS=Proxy_Server:2345 -PU=mydomain\username -PP=pwd123 -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 for a passed execution:
<execution> <Started>2010-07-27 16:49:47</Started> <Param> <Database>QE851</Database> <TestName>TEST_CMD_LINE</TestName> <TestCase>DEFAULT</TestCase> <Prefix>01</Prefix> <ExecOpt>QE851-Folder</ExecOpt> </Param> <Status>Passed</Status> <Test> <LogFolder>Folder</LogFolder> <LogName>48. VP1 2010-07-27 16:49</LogName> </Test> </execution>
This is an example of a log file for a failed execution:
<execution> <Started>2010-07-27 16:47:07</Started> <Param> <Database>QE851</Database> <TestName>TEST_CMD_LINE</TestName> <TestCase>DEFAULT</TestCase> <Prefix>01</Prefix> <ExecOpt>QE851-Folder</ExecOpt> </Param> <Status>Not Completed-FatalError</Status> <Test> <LogFolder>Folder</LogFolder> <LogName>46. VP1 2010-07-27 16:47</LogName> <Message>Browser not initialized.</Message> </Test> </execution>
Whenever you run a test, PTF creates an execution log entry. The log is located in PTF Explorer under the test name, in the log folder specified in Execution Options.
After you run a test, PTF automatically displays the log in the Log Viewer.
You can also view a log by opening it from PTF Explorer.
This example shows log entries in the Logs folder of PTF Explorer:
To open a log from PTF Explorer, do one of the following:
Highlight a log file entry and select Test, Open.
Double-click a log file entry.
Right-click a log file entry and select Open.
This example shows log entries in a test log:
Typically, the Log Viewer includes one high-level entry for each step in the test. Entries for complex steps appear in collapsible sections that can be expanded to view the additional details.
An icon or shaded label appears next to each log entry, indicating the success state of the associated step:
or |
Information message only. |
or |
Information message only. |
or |
Step was successful. |
or |
Step was successful, but with a warning. |
or |
Step failed. |
or |
The test encountered a condition that it was not configured to handle, or the test encountered an error while PTF was configured to stop on all errors. |
Highlight a log entry and select Detail, Go to Test Step or right-click and select Go to Test Step to open the test with the corresponding step selected.
See Also