catt made easy

32
(CATT) (CATT) (CATT) (CATT) Computer Aided Test Tool Made Easy Release 4.6B Prof. Michael A. Molinario St Francis Xavier University PO Box 5000 Antigonish, NS B2G 2V1 (902) 867-3996

Upload: anon-864809

Post on 14-Oct-2014

2.605 views

Category:

Documents


2 download

DESCRIPTION

This document is intended to be a step-by-step set of easily understood instructions, that will allow anyone with navigational understanding of SAP R/3, to create a CATT Test Case designed for either transaction or process testing, or for loading master data to an R/3 Client.

TRANSCRIPT

Page 1: CATT Made Easy

(CATT)(CATT)(CATT)(CATT)

CCCCCCCCoooooooommmmmmmmppppppppuuuuuuuutttttttteeeeeeeerrrrrrrr AAAAAAAAiiiiiiiiddddddddeeeeeeeedddddddd TTTTTTTTeeeeeeeesssssssstttttttt TTTTTTTToooooooooooooooollllllll

MMMMMMMMaaaaaaaaddddddddeeeeeeee EEEEEEEEaaaaaaaassssssssyyyyyyyy Release 4.6B

Prof. Michael A. Molinario St Francis Xavier University PO Box 5000 Antigonish, NS B2G 2V1 (902) 867-3996

Page 2: CATT Made Easy

Introduction This document is intended to be a step-by-step set of easily understood instructions, that will allow anyone with navigational understanding of SAP R/3, to create a CATT Test Case designed for either transaction or process testing, or for loading master data to an R/3 Client.

Table of Contents Setup

1. Prerequisite settings in the Client and in the User ID tables ........................ 1

Using Easy Mode (transaction SCEM)

2. Recording of a transaction as a Test Case ................................................. 7

Using Extended Mode (transaction SCAT)

3. Selecting fields as import parameters ...................................................... 15

4. Exporting parameters to an external file ................................................... 20

5. Working with the exported parameters file ............................................... 21

6. Running the Test Case using external variants ........................................ 25

7. Adding comments to a Test Case ............................................................ 29

8. Conclusion and Feedback. ........................................................................ 30

Page 3: CATT Made Easy

1

Prerequisite Settings Before it is possible to record or run a CATT Test Case, both the R/3 Client and the appropriate User IDs must have CATT authorization.

Client Be sure your R/3 Client is authorized for CATT. Path Tools > Administration > Administration > Client Administration > Client Maintenance Transaction Code SCC4

Procedure On the Display View “Clients”: Overview screen

1. Select the Display -> Change icon [Ctrl+ F4]

The following pop-up information message will appear:

Click Continue [Enter]

Page 4: CATT Made Easy

2

On the Change View “Clients”: Overview screenSelect the Client in which you want to execute CATT. (example shows Client 501 selected)

2. Select the Details icon [Ctrl+Shift+F2]

Page 5: CATT Made Easy

3

On the Change View “Clients”: Details screen 3. In the Restrictions section, the ‘Allows CATT processes to be started’ checkbox must have a check mark.

4. Click the Save icon [Ctrl+S] to save your changes.

Page 6: CATT Made Easy

4

User ID Each CATT user must have authorization to record and run CATT Test Cases. Path Tools > Administration > User Maintenance -> Users Transaction Code SU01

Procedure On the User Maintenance: Initial Screen 1. Enter the UserID for the person to whom you wish to grant CATT authority, and then select the

Change icon [Shift+F6]

This will cause the Maintain User screen to be displayed.

Page 7: CATT Made Easy

5

On the Maintain User screen 2. Select the Defaults tab, and ensure that there is a check mark in ‘Test status’ within the CATT section.

You’ll go to the Activity groups tab next

Page 8: CATT Made Easy

6

Select the ‘Activity groups’ tab 3. Enter SAP_BC_CAT_QUALITYMANAGER_AG as the ‘activity group’ 4. Enter ‘Valid from’ and ‘Valid to’ dates in the appropriate columns 5. Press Enter key to validate (activity group Text = Basis: Test coordinator)

6. Click the Save icon [Ctrl+S] to save your changes.

Page 9: CATT Made Easy

7

Record a transaction in Easy Mode There are two modes in which CATT can be run. Easy Mode [SCEM] is simple but lacks the power of the Extended Mode [SCAT]. Easy Mode is adequate for recording a transaction. Path Tools > ABAP Workbench > Test > Test Workbench > CATT Transaction Code SCEM

Procedure On the CATT – Initial screen 1. Enter a name for the Test Case you want to create into the ‘Test case’ field

Note: The name must start with a ‘Y’ or ‘Z’, have no blank spaces or special characters, and should include the transaction code within the name. (in the example below, the transaction code is FK01)

2. Select the Create icon [F5]

The CATT – Record transaction dialog box will appear

3. Enter the transaction code of the transaction to be recorded in the ‘Transaction’ field (i.e., FK01)

4. Select the Record button to start recording the specified transaction.

Page 10: CATT Made Easy

8

In this case, the system has taken us to the ‘Create Vendor: Initial Screen’, where we will record the transaction by running it, being sure to make entries in every field we want to update as part of the Test Case. Note: Whenever a field is assigned internally, as ‘Vendor’ is in this example you must put one blank space into the internally assigned field. On the Create Vendor: Initial Screen 5. Make entries into the following fields: Vendor: ‘ ‘ (one blank space) Company code: '0001' (in this example) Account group: 'KRED' (in this example)

6. Press the Enter key or click on the Enter icon to continue to the next screen Note: Each time you move from one screen to the next, a Stopwatch icon with the wording "Recording running…" will appear temporarily at the left end of the Status Bar.

Page 11: CATT Made Easy

9

On the resulting Create Vendor: Address screen… 7. Enter data into the following fields (or those of your choosing):

Name* Search term 1/2 * Street Postal Code City Country* Region P.O. Box Telephone

* denotes Required Field

8. Press the Enter key or click on the Enter icon to continue to the next screen

Page 12: CATT Made Easy

10

On the resulting Create Vendor: Control screen… 9. Enter a valid Industry code value

Industry = '0003'

10. Press the Enter key or click on the Enter icon twice to continue through the Create Vendor: Payment Transactions screen and on to the next screen

Page 13: CATT Made Easy

11

On the resulting Create Vendor: Accounting Information Accounting screen… 11. Enter a valid value for the Reconciliation Account Recon. Account = '160000'

12. Click the Save icon [Ctrl+S] to save your transaction entries and return you to the CATT - Initial screen , which will have the CATT - Record transaction dialog box superimposed.

Page 14: CATT Made Easy

12

Note: The message in the Status Bar indicating that " Vendor 0000100126 was created in company code 0001". An actual vendor record was created in the act of recording the Test Case.

On the superimposed CATT - Record transaction dialog box…

13. Click on the End and copy into test case icon [Shift+F12] to end the recording of the Test Case and take you to the next screen.

Page 15: CATT Made Easy

13

On the resulting Change test case ( your test case ID ) screen… Note: The left column indicates your test case ID (highlighted in green), while its sub-item and the right side show you the transaction you recorded.

14. Expand the recorded transaction in the left column by clicking on the icon. The resulting list should be like the one below.

Note: Each represents a screen in the recorded transaction.

15. Click the Save icon [Ctrl+S] to save your test case.

Note: The confirmation message appears in the Status Bar.

16. Click the Back icon [F3] to return to the CATT - Initial screen

Page 16: CATT Made Easy

14

The CATT - Initial screen shows that your new test case has been added under 'My favorites'

Your CATT Test Case to Create a Vendor has now been fully recorded.

17. Click the Back icon [F3] to return to the SAP Easy Access screen

Page 17: CATT Made Easy

15

Selecting fields as import parameters Since running the Test Case we just created would result in an identical record, except of course for the Vendor Number, if we want some of the field values (parameters) in the record to change we must first identify the fields we would like to make variable; these are called import parameters. We will use the CATT Extended mode to do this. Path Tools > ABAP Workbench > Test > Test Workbench >CATT Extended Transaction Code SCAT

Procedure On the Computer Aided Test Tool: Initial Screen 1. Enter a name for the Test Case with which you want to work into the ‘Test case’ field. 2. Select the ‘Functions’ radio button.

3. Click on the Change button to advance to the CATT: Maintain Functions Test case screen.

Page 18: CATT Made Easy

16

On the CATT: Maintain Functions Test case… screen 4. Select the table row containing the transaction code (TCD) for which you want to define parameters, and

then click on the Details icon (or double click on the TCD row)

This will display the CATT: Function Detail TCD Test case… screen. This screen lists all of the screens that were recorded in your test case. On the CATT: Function Detail TCD Test case… screen 5. Select (with a single click) the transaction screen on which there are fields you want to make variable.

In this example, screen number “0111” has been selected.

6. Then click the Field list icon [Shift+F5] to list the available fields on that screen.

Page 19: CATT Made Easy

17

The CATT: Maintain Input Values SAPMFK02K 0111 Test cas e Z20_FK01_2 screen is displayed (where “SAPMFK02” is the program name, “0111” is the screen number, and “Z20_FK01_2” is the test case) Note: The field names in which we entered data when creating the test case are shown in blue font, starting with “Name1” and ending with “Telephone”. The fields on that screen which were not used are in black font. The ‘New field contents’ column shows the values we entered in the respective fields. If we do not define parameter variables for these fields, the exact same values will be defaulted into the record created the next time the test case is run. 7. In order to make the “ADDR1_DATA-NAME1” field variable, double click anywhere on that table row.

This will cause the Create parameters/variables dialog box to be displayed.

Note: A Parameter name (equal to the first character of the Keyword) is automatically suggested. WARNING: The same Parameter name may be supplied for more than one field in the test case, however the parameter names must be unique within the test case. Therefore, you will want to change names in the Create parameters/variables dialog box to eliminate duplicates. i.e.: The parameter names for “Search term” and “Street” would both default to “S.” You might want to change the Parameter name for “Search term” to “S1” and the name for “Street” to “S2.”

8. Click the Continue icon [F8] to accept the parameter name and advance to the next screen.

Page 20: CATT Made Easy

18

On the resulting Maintain Import paramete r Test case… screen

9. Click the Continue icon [F8] to create the import parameter and return to the CATT: Maintain Input Values SAPMFK02K 0111 Test case Z20_FK01_2 screen.

Note: The Parameter name [&N] is displayed in the “New field contents” column.

Repeat steps 7, 8, and 9 for each field on the screen (“0111” in this example) for which you want to establish a parameter import variable. Go back to step 5 to select fields on a different screen in the test case.

Page 21: CATT Made Easy

19

10. When you have finished identifying parameter import variables, click three times on the Back icon [F3] until you return to the CATT: Maintain Functions Test case… screen AND the Exit maintenance dialog box is displayed.

11. On the Exit maintenance dialog box, select the Yes button to save the test case changes. This will return you to the Computer Aided Test Tool: Initial Screen .

Page 22: CATT Made Easy

20

Exporting parameters to an external file Having defined your import parameters for the test case, you now need to export those parameters to an external file where values can be added or manipulated before being used later as input (import) to the test case when it is run. The test case built in the previous pages of this document will continue to serve as an example. We will use the CATT Extended mode to do this. Path Tools > ABAP Workbench > Test > Test Workbench >CATT Extended Transaction Code SCAT

Procedure On the Computer Aided Test Tool: Initial Screen 1. Enter a name for the Test Case with which you want to work into the ‘Test case’ field.

2. Follow the menu path: Goto > Variants > Export Note: This takes you to the Transfer to a Local File dialog box. A path and text file name, equal to the test case name, has already been suggested.

3. Click on the Transfer button [Enter] to save the parameters file to your local drive. Note: The Computer Aided Test Tool: Initial Screen will be displayed with a confirmation message in the

status bar.

Page 23: CATT Made Easy

21

Working with the exported parameters file No that you have created an external file containing the parameters and default values for the test case, you will want to work with the file to add some new values for the parameters.. In order to do this, you will open the external text file in a spreadsheet program [MS Excel], make entries for additional records, and then save the data back to the original .TXT file. We will use the external file created on the previous page for this example.. 1. Start MS Excel and Open the .TXT file created in the previous page.

You will now be lead through a series of Text Import Wizard screens.

Page 24: CATT Made Easy

22

On the Text Import Wizard – Step 1 of 3 dialog box Note: The Delimited button is ON, the import will start at Row 1, and there are four (4) rows in the table.

2. Accept these settings by clicking on the Next button.

On the Text Import Wizard – Step 2 of 3 dialog box Note: The Delimiters are identified as Tab.

3. Accept these settings by clicking on the Next button.

Page 25: CATT Made Easy

23

On the Text Import Wizard – Step 3 of 3 dialog box Note: The Column data format is set to Text. (this should allow capture of leading zeros)

4. Accept these settings by clicking on the Finish button. This will return you to the Worksheet, but now the first four rows are populated.

Note: Although these four rows will be ignored when imported back to CATT, Do Not Delete them.

Page 26: CATT Made Easy

24

5. Now add rows of variant data. Note: When imported back to CATT for running a test case, the test case will automatically execute once for every variant row, starting with row 5.

Note: Since the variants in column D are the same as the default value at D3, it would not be necessary to populate D5:D13 (but it doesn’t hurt to do it as shown). However , unless you want every new record created to have the same PO Box as the default… be sure that the Proposed values for that column is blank. 6. Follow the path Edit > Save As… , when variant entries are completed, to save back to the original .TXT

file.

Note: You have now captured your variants for this test case. It would be possible to create other sets of variants for the same test case by giving the additionally created.TXT files slightly different names.

Page 27: CATT Made Easy

25

Running the Test Case using external variants Having created your file of import variants, it’s now time to import them back to be used by the test case. The variants built in the previous pages of this document will continue to serve as an example. We will use the CATT Extended mode to do this. Path Tools > ABAP Workbench > Test > Test Workbench >CATT Extended Transaction Code SCAT

Procedure On the Computer Aided Test Tool: Initial Screen 1. Enter a name for the Test Case you want to run into the ‘Test case’ field.

2. Select the Execute icon [F8].

Note: This will result in the CATT: Execute Test case… screen being displayed. (see next page) This screen displays the Text Case attributes, where the user can select the Log type , Processing mode , and Variants (source)for use in this test run. In addition, Import parameters established for this test case are displayed and the user has the option of overriding the default value for any of the import parameters.

Page 28: CATT Made Easy

26

Log type: After a test case is run, CATT will produce a Test Log. You choose between Long (detailed), Short, or W/o (no log).

Processing mode: You choose between running the test in Foreground (every screen is displayed and requires operator intervention to advance), Background (no operator intervention), or Errors (similar to background, but will stop the test and display any screen on which an error is encountered).

Variants: There are too many options to discuss each in detail. For this example we will be using the External from file option.

Information on other options can be obtained by selecting an option and clicking on the

Help icon [F1].

Import parameters: Leave “Parameter values” blank for the purpose of this example.

Page 29: CATT Made Easy

27

3. Make the following selections on the CATT: Execute Test case… screen Log type = “Long” Processing mode = “Background” Variants = “External from file”

4. Select the Choose button to look for the .TXT file. This will display the Choose external variant file dialog box

5. Select the appropriate file and then click on the Open button . Note: This will take you back to the CATT: Execute Test case… screen, where the selected file will be displayed in the Variants group box.

Page 30: CATT Made Easy

28

On the CATT: Execute Test case… screen

6. Visually verify your file selection, and then select the Execute icon [F8] to run the test case using the import parameters from the external file.

Note: As the Test Case runs in the background, in the status bar, you will see references each time the test case is run. When the job is finished, the CATT – Test Plan Log for Run… screen will be displayed automatically. Note: The Log below has already been partially expanded. (Errors will display in red. This log has none.)

Page 31: CATT Made Easy

29

Adding comments to a Test Case In order to perform this function, we will again use the Extended Mode. Path Tools > ABAP Workbench > Test > Test Workbench > CATT Extended Transaction Code SCAT

Procedure On the Computer Aided Test Tool : Initial screen 1. Enter a name for the Test Case, for which you want to add a comment, into the ‘Test case’ field.

Note: The name must be a valid, existing test case name.

2. Select the Change icon

The CATT: Maintain Functions Test case… screen will be displayed

3. Click in the Funct. column on the first blank line, and then enter “TXT.” 4. Click in the Text column of the same blank line, and enter your comment.

5. Click the Save icon [Ctrl+S] to save your comment in the test case.

6. Click twice on the Back icon [F3] to return to the SAP Easy Access screen.

Page 32: CATT Made Easy

30

Conclusion With this guidebook you should have been able to:

• Complete preparatory settings in the R/3 Client and in the User ID to allow CATT transactions

• Record a “Create Vendor” master data transaction as a Test Case

• Selecting fields from a screen in the Test Case and establish them as import parameters

• Export default values for the established parameters to an external text file

• Extend the external parameters file with variants to create several records in one CATT run

• Run the Test Case using external variants and receive a Test Log

• Add documentary comments to a Test Case using the TXT function

If you have been able to do these things… Congratulations! You now have more practical CATT skills than most R/3 implementation team members in North America, including the majority of Consultants. These few activities will allow you to record transactions to load data and to run simple transaction (unit) tests. Although these are not trivial activities, we have just scratched the surface of CATT capabilities. The CATT tool is far more powerful and sophisticated features than this tutorial (or this writer) could ever hope cover.

Feedback I would sincerely appreciate your constructive comments about this guidebook; its design, any omissions or inaccuracies you’ve identified, or recommendations for topics to be included. Your comments will help me to improve the quality and usefulness of this document over time. Send your comments to me via E-mail at [email protected]. Thank you.