Скачать презентацию e CATT VSDK 3 0 Target Group Скачать презентацию e CATT VSDK 3 0 Target Group

1f326148483adcc8f81c7d5b60bdd14f.ppt

  • Количество слайдов: 134

e. CATT VSDK 3. 0 e. CATT VSDK 3. 0

Target Group and Prerequisites Target Group n Implementation and integration teams n Quality managers Target Group and Prerequisites Target Group n Implementation and integration teams n Quality managers supervising in-house development Prerequisites n Experience of software testing n An understanding of the architecture of the SAP Web Application Server (as provided in course SAPTEC) ã SAP AG 2005, Title of Presentation / Speaker Name / 2

Course Goals In this course, you will learn n What and when you need Course Goals In this course, you will learn n What and when you need to test in the SAP Solution Lifecycle n The advantages of e. CATT for testing SAP systems compared with other automated test tools n How to set up your system environment for testing with e. CATT n How to create test cases to test various different kinds of SAP applications n How to create executable tests, and how these can be managed using the SAP Test Workbench n How to migrate CATT objects to e. CATT ã SAP AG 2005, Title of Presentation / Speaker Name / 3

Contents Unit 1 Getting Ready to Test Unit 2 Getting Ready to Test with Contents Unit 1 Getting Ready to Test Unit 2 Getting Ready to Test with e. CATT Unit 5 Testing Transactions - I Unit 6 Testing Transactions - II Unit 7 Testing Transactions - III Unit 3 e. CATT Scripts and the Script Editor Unit 4 Non-UI Testing ã SAP AG 2005, Title of Presentation / Speaker Name / 4 Unit 8 Building Executable Tests Unit 9 Advanced Topics

Unit 1: Getting Ready to Test Unit 1: Getting Ready to Test

Unit Objectives In this unit, you will learn: n When you need to test Unit Objectives In this unit, you will learn: n When you need to test in your SAP environment n The advantages and disadvantages of manual and automated testing n Decision criteria for selecting an automated test tool n What can be tested using SAP e. CATT ã SAP AG 2005, Title of Presentation / Speaker Name / 6

Occasions for Testing New SAP installations Addition and integration of new components In-house developments Occasions for Testing New SAP installations Addition and integration of new components In-house developments n Functional Tests n Integration tests with other components Upgrades – regression testing Application of Legal Change Packages ã SAP AG 2005, Title of Presentation / Speaker Name / 7

Manual or Automated Testing Manual Testing n Requires a group of testers who must Manual or Automated Testing Manual Testing n Requires a group of testers who must u Have lab space to work in u Be trained u Be released from their other duties (internal) or “bought-in” (external) n Is time-consuming n Offers little potential for reuse of test resources n But does have the advantage that manual testers spot errors and issues that are beyond the scope of the test plan Automated Testing n Requires fewer people and resources n Execution takes less time n Parameterization of fields allows replay with any number of different sets of values n Offers considerable possibilities for reusing test scripts n Makes it easier to reproduce errors that occur during testing ã SAP AG 2005, Title of Presentation / Speaker Name / 8

The Economics of Testing Automated testing requires good planning and modeling Learning to use The Economics of Testing Automated testing requires good planning and modeling Learning to use a new test tool takes time An automated test script will only give you maximum ROI if it is reusable A switch to automated testing requires investment and commitment Not every test scenario has to be automated n If it doesn't have to be repeatable, it doesn't necessarily have to be automated n Automation is a means to an end, not an end in itself. If it is taking too long to automate the last 5% of your test scenario, consider running that part manually! ã SAP AG 2005, Title of Presentation / Speaker Name / 9

Choosing an Automated Test Tool – External Tools Classic automated test tools can test Choosing an Automated Test Tool – External Tools Classic automated test tools can test an SAP System by driving the SAP GUI. . . Automated Test Tool n Generally not aware of the multiple tier solution n No access to what is happening on the application server or the database ã SAP AG 2005, Title of Presentation / Speaker Name / 10 Backend . . . But treat the SAPGUI Window as a standalone desktop application: SAPGUI Window Frontend Script

Choosing an Automated Test Tool – SAP CATT – Computer Aided Test Tool Available Choosing an Automated Test Tool – SAP CATT – Computer Aided Test Tool Available from Release 3. 0 Advantages n Shipped free with SAP Basis System n Most effective testing method for SAP transactions Disadvantages n Control technology not fully supported n No support for tabular parameters of function modules n Only limited support for distributed system environments n Only limited support for external applications ã SAP AG 2005, Title of Presentation / Speaker Name / 11

Choosing an Automated Test Tool - SAP e. CATT The Extended Computer Aided Test Choosing an Automated Test Tool - SAP e. CATT The Extended Computer Aided Test Tool (e. CATT) is the successor to SAP‘s CATT. Its design aims were to n Enable as many SAP transactions as possible to be tested automatically n Provide a simplified concept for testing in a complex system landscape n Allow reuse of test data by storing it in separate container objects n Leverage the benefits of the existing CATT e. CATT is available with Release 6. 20 of the SAP Web Application Server With it, you can remotely test any my. SAP. com solution that is running R/3 Basis Release 4. 6 C or higher (see note 519858 for details of required support packages) ã SAP AG 2005, Title of Presentation / Speaker Name / 12

What Applications Can Be Tested Using e. CATT? . . . Using Built-In e. What Applications Can Be Tested Using e. CATT? . . . Using Built-In e. CATT Means Transactions in SAP GUI for Windows Transactions in SAP GUI for Java Function Modules and BAPIs . . . Using e. CATT Together With a Certified External Tool Web-based Transactions Desktop-based transactions ã SAP AG 2005, Title of Presentation / Speaker Name / 13

What Does Testing an Application Mean? Making the test reusable Setting checks on the What Does Testing an Application Mean? Making the test reusable Setting checks on the application to make the test react to different circumstances Parameterizing the application to allow it to be replayed with varying values Recording the application so that it can be replayed ã SAP AG 2005, Title of Presentation / Speaker Name / 14

What Systems Can Be Tested Using e. CATT? You require at least one SAP What Systems Can Be Tested Using e. CATT? You require at least one SAP Web Application Server 6. 20 to operate as a test server From this central test system, you can test any other system that is running the component SAP_BASIS with Release 4. 6 Support Package 32 or higher R/3 CRM e. CATT Web AS 6. 20 ã SAP AG 2005, Title of Presentation / Speaker Name / 15 APO

Unit Summary In this unit, you have learned n Some of the issues you Unit Summary In this unit, you have learned n Some of the issues you have to consider in deciding a test strategy n The functional test tools that are available from SAP n The scope of e. CATT u The applications that you can test with it u The system landscape in which you can test ã SAP AG 2005, Title of Presentation / Speaker Name / 16

Unit 2: Getting Ready to Test With e. CATT Unit 2: Getting Ready to Test With e. CATT

Unit Objectives In this unit, you will learn: n How a finished e. CATT Unit Objectives In this unit, you will learn: n How a finished e. CATT test case is put together n The different object types used in e. CATT n How to set up a system for use with e. CATT n Some of the security aspects that you need to consider ã SAP AG 2005, Title of Presentation / Speaker Name / 18

A Finished Example Test Configuration System Landscape Description Test Instructions Results ã SAP AG A Finished Example Test Configuration System Landscape Description Test Instructions Results ã SAP AG 2005, Title of Presentation / Speaker Name / 19 Data to drive the test Archive

The Different Object Types Test Script The set of commands that forms the test The Different Object Types Test Script The set of commands that forms the test System Data Container A list of systems that are addressed during the execution of a test script Test Data Container Reusable sets of data that can be used to run tests Test Configuration A test script, combined with data from one or more test data containers, plus a system data container that describes the correct system landscape ã SAP AG 2005, Title of Presentation / Speaker Name / 20

Constructing an Automated Test Series What applications am I going to test? What does Constructing an Automated Test Series What applications am I going to test? What does my system landscape look like? How can I best create an automated test for my applications? What data do I need to drive the tests? How can I organize my test cases? Test data container System data container 1 2 4 3 Test script ã SAP AG 2005, Title of Presentation / Speaker Name / 21 5 Test Workbench

Setting Up the System Support Package Levels n Each system in which you want Setting Up the System Support Package Levels n Each system in which you want to test must have at least the following support package level u 4. 6 C: Support Package 32 u 4. 6 D: Support Package 21 u 6. 10: Support Package 17 Client Settings n In each client in which you want to test, you must ensure that the CATT/e. CATT flag is set to allow tests to run GUI Scripting n In order to use the new GUI Scripting functions, the following settings have to be made: u Profile parameter sapgui/user_scripting must be set to TRUE u SAP GUI must be Version 6. 20 with patch level =>18 and GUI Scripting installed ã SAP AG 2005, Title of Presentation / Speaker Name / 22

Mapping the System Landscape 1. 2. e. CATT Web AS 6. 20 3. 4. Mapping the System Landscape 1. 2. e. CATT Web AS 6. 20 3. 4. Test CRM transaction Check table entries in R/3 Run transaction in R/3 Call function module in APO RFC CRM R/3 Business Process ã SAP AG 2005, Title of Presentation / Speaker Name / 23 APO

Defining RFC Destinations Target System Source System RFC Destination Client: Lang: User: Pwd: 100 Defining RFC Destinations Target System Source System RFC Destination Client: Lang: User: Pwd: 100 EN tester letmein Direct but unsafe Target Transaction Safe but cannot run unattended RFC Destination Client: 100 Lang: EN User: ã SAP AG 2005, Title of Presentation / Speaker Name / 24 Target Transaction

Function of System Data Containers Test Script System Data Container Command With Logical Target Function of System Data Containers Test Script System Data Container Command With Logical Target < -- > RFC Dest. Target System The logical target describes the function of the system – for example R/3. The system data container maps the logical name to a particular RFC destination. ã SAP AG 2005, Title of Presentation / Speaker Name / 25

Creating a System Data Container System under test SAP Web AS 6. 20 Relationship Creating a System Data Container System under test SAP Web AS 6. 20 Relationship described by RFC destination XYZ Target system . . . RFC Destination XYZ R 3 System Data Container ã SAP AG 2005, Title of Presentation / Speaker Name / 26 . . .

Advantages of System Data Containers Consistency n One container can serve a whole project Advantages of System Data Containers Consistency n One container can serve a whole project n The RFC destinations can contain the client, language, and user name for the logon – eliminates sources of errors n Access to SM 59 and the authorization to create system data containers can be restricted to project leads Reuse n Using logical system names in a script means that the execution environment of the script can be changed by switching system data containers. Changes in the script coding are not required. ã SAP AG 2005, Title of Presentation / Speaker Name / 27

Unit Summary In this unit, you have learned n The different object types with Unit Summary In this unit, you have learned n The different object types with which you work in e. CATT n How these object types support you in the various stages of planning an automated test project n How to set up a system to enable e. CATT n How to define secure RFC destinations n How to create a system data container ã SAP AG 2005, Title of Presentation / Speaker Name / 28

Unit 3: e. CATT Scripts and the Script Editor Unit 3: e. CATT Scripts and the Script Editor

Unit Objectives In this unit you will learn: n The structure of an e. Unit Objectives In this unit you will learn: n The structure of an e. CATT script n The essential features of the e. CATT script editor n The main aspects of the e. CATT scripting language n How to work with parameters ã SAP AG 2005, Title of Presentation / Speaker Name / 30

Design Considerations for a Script Definite Goal Before you write your script, work out Design Considerations for a Script Definite Goal Before you write your script, work out exactly what you want it to do Reusability Try to create small self-contained script modules. This will make them more easily reusable. ã SAP AG 2005, Title of Presentation / Speaker Name / 31

Structure of a Script Test Script Attributes Parameters Importing Local variables Commands ã SAP Structure of a Script Test Script Attributes Parameters Importing Local variables Commands ã SAP AG 2005, Title of Presentation / Speaker Name / 32 Exporting

Script Attributes Administrative data about the script Search terms: Can be used in Infosystem Script Attributes Administrative data about the script Search terms: Can be used in Infosystem Attaches system data container to script, allowing access to other systems ã SAP AG 2005, Title of Presentation / Speaker Name / 33

The Script Editor Parameter List Command Editor ã SAP AG 2005, Title of Presentation The Script Editor Parameter List Command Editor ã SAP AG 2005, Title of Presentation / Speaker Name / 34 Structure Editor

Simple Parameters Creation Use I_IMPORT = 'LH'. CHEVAR ( I_IMPORT <> 'UA' ). . Simple Parameters Creation Use I_IMPORT = 'LH'. CHEVAR ( I_IMPORT <> 'UA' ). . ã SAP AG 2005, Title of Presentation / Speaker Name / 35

Structured Parameters Use I_STRUCTURE-CARRID = 'LH'. I_ITAB[2]-CONNID = '0400'. GETLEN ( I_ITAB, VAR ). Structured Parameters Use I_STRUCTURE-CARRID = 'LH'. I_ITAB[2]-CONNID = '0400'. GETLEN ( I_ITAB, VAR ). ã SAP AG 2005, Title of Presentation / Speaker Name / 36

Script Language Recording and playback of applications Conditions Checks Loops Calculations Simulation of Customizing Script Language Recording and playback of applications Conditions Checks Loops Calculations Simulation of Customizing settings Reading table values Blocks of ABAP coding ã SAP AG 2005, Title of Presentation / Speaker Name / 37

Commands for Recording Applications Recording and playback of applications FUN calls a function module Commands for Recording Applications Recording and playback of applications FUN calls a function module TCD allows you to record and replay SAP transactions SAPGUI allows you to record sequences of screens containing controls An interface allows you to integrate test tools from third-party vendors with SAP e. CATT ã SAP AG 2005, Title of Presentation / Speaker Name / 38

Choosing the Right Driver Is the application a function module or BAPI? No Yes Choosing the Right Driver Is the application a function module or BAPI? No Yes Use FUN Does the application run under SAP GUI for Windows or Java? Use ext. tool No Yes Does the application use controls? Use TCD No Yes No single driver provides the best solution for every application No Are the controls essential within the transaction? Yes Use SAPGUI ã SAP AG 2005, Title of Presentation / Speaker Name / 39

Special Variables &SZBRC - Return code &TIME - Current time &DATE – Current date Special Variables &SZBRC - Return code &TIME - Current time &DATE – Current date &YEAR – Current year &YEARA – Next year &YEARB – Last year &LPC – Loop counter &MSX – Number of messages returned by a transaction &USER – User name &CLIENT – Current client ã SAP AG 2005, Title of Presentation / Speaker Name / 40

Pattern Function The Pattern function is similar to the statement pattern in the ABAP Pattern Function The Pattern function is similar to the statement pattern in the ABAP Editor. It allows you to build individual e. CATT commands. A command consists of: n The command keyword n Argument (the target object) n Interface (parameters that need to be passed) n Target system ã SAP AG 2005, Title of Presentation / Speaker Name / 41

Command Interface Most e. CATT commands have a command interface, which corresponds to: n Command Interface Most e. CATT commands have a command interface, which corresponds to: n The interface of a function module (for FUN) n The screen and field structure of a transaction (for TCD) n A list of user interactions (for SAPGUI) n The importing and exporting parameters of a referenced script Command interfaces are stored in XML format in the local system, even if the object that they describe only exists in a remote system. ã SAP AG 2005, Title of Presentation / Speaker Name / 42

Unit Summary In this unit, you have learned n The various areas of the Unit Summary In this unit, you have learned n The various areas of the e. CATT Test Script Editor n The features of the e. CATT script language n How to create e. CATT parameters n How to use the pattern function in the e. CATT Script Editor n Which driver to use for various kinds of applications ã SAP AG 2005, Title of Presentation / Speaker Name / 43

Unit 4: Non-UI Testing Function Modules and BAPIs Table Operations Inline ABAP Unit 4: Non-UI Testing Function Modules and BAPIs Table Operations Inline ABAP

Unit Objectives In this unit you will learn: n How to test function modules Unit Objectives In this unit you will learn: n How to test function modules and BAPIs n How to read from and test against the database n How to use blocks of ABAP coding to enhance your test scripts ã SAP AG 2005, Title of Presentation / Speaker Name / 45

Choosing the Right Driver Is the application a function module or BAPI? Yes Use Choosing the Right Driver Is the application a function module or BAPI? Yes Use FUN ã SAP AG 2005, Title of Presentation / Speaker Name / 46

Non-UI Testing: Function Modules Unit Test Whole Backend Process Function Module Transaction Function Module Non-UI Testing: Function Modules Unit Test Whole Backend Process Function Module Transaction Function Module Transaction ã SAP AG 2005, Title of Presentation / Speaker Name / 47 Utility Within a Script

Testing Function Modules FUN ( <function module>, <interface>, [<target>] ). Command Interface Importing Exporting Testing Function Modules FUN ( , , [] ). Command Interface Importing Exporting Changing Tables Exceptions ã SAP AG 2005, Title of Presentation / Speaker Name / 48 Function Module

Parameterizing the Interface or INTERFACE-IMPORTING-PARAMETERNAME = value. INTERFACE-IMPORTING-STRUCTURE-FIELDNAME = value. INTERFACE-TABLES-TABLE[idx]-FIELDNAME = value. ã Parameterizing the Interface or INTERFACE-IMPORTING-PARAMETERNAME = value. INTERFACE-IMPORTING-STRUCTURE-FIELDNAME = value. INTERFACE-TABLES-TABLE[idx]-FIELDNAME = value. ã SAP AG 2005, Title of Presentation / Speaker Name / 49

Trapping Exceptions Interface Exceptions DATA_INCOMPLETE CREATE_FAILED ã SAP AG 2005, Title of Presentation / Trapping Exceptions Interface Exceptions DATA_INCOMPLETE CREATE_FAILED ã SAP AG 2005, Title of Presentation / Speaker Name / 50

Table Operations Test Script Database GETTAB ( TAB, INTF, [DEST] ). CHETAB ( TAB, Table Operations Test Script Database GETTAB ( TAB, INTF, [DEST] ). CHETAB ( TAB, INTF, [DEST] ). Application Table SETTAB ( TAB, INTF, [DEST] ). RESTAB ( TAB, [DEST] ). ã SAP AG 2005, Title of Presentation / Speaker Name / 51 Customizing Table

Using Inline ABAP. * Any ABAP Coding that is allowed in a subroutine * Using Inline ABAP. * Any ABAP Coding that is allowed in a subroutine * may appear here ENDABAP. Parameters Name Description Value V_TAB SFLIGHT-table I/E/V V Ref Type SFLIGHT[] ABAP. SELECT * FROM sflight INTO TABLE v_tab WHERE carrid = ‘LH’ AND connid = ‘ 0400’. ENDABAP. Expecting a result set of more than one line. No corresponding function module available. “Once-off” query ã SAP AG 2005, Title of Presentation / Speaker Name / 52

Unit Summary In this unit you have learned: n How to test function modules Unit Summary In this unit you have learned: n How to test function modules and BAPIs n How to read from and test against the database n How to use blocks of ABAP coding to enhance your test scripts ã SAP AG 2005, Title of Presentation / Speaker Name / 53

Unit 5: Testing Transactions - I Testing conventional transactions using the TCD command Unit 5: Testing Transactions - I Testing conventional transactions using the TCD command

Unit Objectives In this unit you will learn: n What transactions are suitable for Unit Objectives In this unit you will learn: n What transactions are suitable for testing using the TCD command n How to record a transaction using the TCD command n How to set input fields, read output fields, and perform fields checks with the TCD command ã SAP AG 2005, Title of Presentation / Speaker Name / 55

Choosing the Right Driver Is the application a function module or BAPI? No Does Choosing the Right Driver Is the application a function module or BAPI? No Does the application run under SAP GUI for Windows or Java? Yes Does the application use controls? Use TCD No Yes No Are the controls essential within the transaction? ã SAP AG 2005, Title of Presentation / Speaker Name / 56

Characteristics of the TCD Command The TCD command is the recording technique that was Characteristics of the TCD Command The TCD command is the recording technique that was used to test transactions in CATT It is based on the Batch Input Interface It allows you to record a transaction, parameterize its input fields, and read or set checks against its output fields ã SAP AG 2005, Title of Presentation / Speaker Name / 57

Background: The Batch Input Interface Background: Data-consistency checks in SAP transactions are often implemented Background: The Batch Input Interface Background: Data-consistency checks in SAP transactions are often implemented within the coding of the screen flow logic (Process After Input) Batch Input is a technique originally developed for data transfer from legacy systems into an R/3 System that processes transactions in the background CATT used this technique for unattended transaction testing. It is a very efficient testing method, and has consequently been retained in e. CATT ã SAP AG 2005, Title of Presentation / Speaker Name / 58

The TCD Command TCD ( transaction, interface, [sys] ) Same system Different system ã The TCD Command TCD ( transaction, interface, [sys] ) Same system Different system ã SAP AG 2005, Title of Presentation / Speaker Name / 59

How TCD Really Works - Recording ENTER FIELD VBAK-AUART VBAK-VKORG. . . BDC_OKCODE ã How TCD Really Works - Recording ENTER FIELD VBAK-AUART VBAK-VKORG. . . BDC_OKCODE ã VALUE AF 1000 ENT 2 SAP AG 2005, Title of Presentation / Speaker Name / 60 FIELD KUAGV-KUNNR VBAP-MATNR. . . BDC_OKCODE VALUE 1280 P-103 SICH

How TCD Really Works - Replay No SAP GUI session Field values FIELD VBAK-AUART How TCD Really Works - Replay No SAP GUI session Field values FIELD VBAK-AUART VBAK-VKORG. . . BDC_OKCODE ã VALUE AF 1000 ENT 2 SAP AG 2005, Title of Presentation / Speaker Name / 61 Function code FIELD KUAGV-KUNNR VBAP-MATNR. . . BDC_OKCODE VALUE 1280 P-103 SICH

The Command Interface Transaction Screen Field Screen Field ã SAP AG 2005, Title of The Command Interface Transaction Screen Field Screen Field ã SAP AG 2005, Title of Presentation / Speaker Name / 62

Parameterizing Input Fields You can replace the recorded values with either literals or variables Parameterizing Input Fields You can replace the recorded values with either literals or variables Field name Double-click ã SAP AG 2005, Title of Presentation / Speaker Name / 63 Value

Reading and Checking Output Fields To. . . MODE must be. . . Field Reading and Checking Output Fields To. . . MODE must be. . . Field name in VALIN column Read a value 'G' Will contain value from output field at the end of the transaction Check a value 'C' Contains the value that must be present in the screen field at runtime ã SAP AG 2005, Title of Presentation / Speaker Name / 64

Message Handling TCD Command Interface Location of message (program and screen) Message attributes MSG Message Handling TCD Command Interface Location of message (program and screen) Message attributes MSG Internal Table (type, ID, number) Message variables (up to four) Number of messages &MSX ã SAP AG 2005, Title of Presentation / Speaker Name / 65 Full text of message (in logon language)

Reading Message Contents Addressing the Last Message <interface>-MSG[&MSX]-<component> Looping Through All Messages DO &MSX. Reading Message Contents Addressing the Last Message -MSG[&MSX]- Looping Through All Messages DO &MSX. -MSG[&LPC]- ENDDO. ã SAP AG 2005, Title of Presentation / Speaker Name / 66

Testing Messages Require that a particular message is sent ON_LAST_MESSAGE_CHECK ( 031 ). TCD Testing Messages Require that a particular message is sent ON_LAST_MESSAGE_CHECK ( 031 ). TCD ( EC_TUTORIAL_TCD, EC_TUTORIAL_TCD_1 ). Tolerate all messages ON_LAST_MESSAGE_CHECK ( * ). TCD ( EC_TUTORIAL_TCD, EC_TUTORIAL_TCD_1 ). ã SAP AG 2005, Title of Presentation / Speaker Name / 67

Troubleshooting the TCD Command ã SAP AG 2005, Title of Presentation / Speaker Name Troubleshooting the TCD Command ã SAP AG 2005, Title of Presentation / Speaker Name / 68

Unit Summary In this unit you have learned: n What transactions are suitable for Unit Summary In this unit you have learned: n What transactions are suitable for testing using the TCD command n How to record a transaction using the TCD command n How to set input fields, read output fields, and perform fields checks with the TCD command ã SAP AG 2005, Title of Presentation / Speaker Name / 69

Unit 6: Testing Transactions - II Testing control-based transactions using the SAPGUI command Unit 6: Testing Transactions - II Testing control-based transactions using the SAPGUI command

Unit Objectives In this unit, you will learn: n Why the TCD driver is Unit Objectives In this unit, you will learn: n Why the TCD driver is not suitable for testing all transaction types n How GUI Scripting works n How to use the e. CATT SAPGUI command to record a transaction n How to set input fields, read output fields, and perform field checks in a SAPGUI recording ã SAP AG 2005, Title of Presentation / Speaker Name / 71

Choosing the Right Driver Is the application a function module or BAPI? No Does Choosing the Right Driver Is the application a function module or BAPI? No Does the application run under SAP GUI for Windows or Java? Yes Does the application use controls? Yes Are the controls essential within the transaction? Yes Use SAPGUI ã SAP AG 2005, Title of Presentation / Speaker Name / 72

Backend Frontend Why TCD Cannot Test Everything ã OCX control under Windows Bean under Backend Frontend Why TCD Cannot Test Everything ã OCX control under Windows Bean under Java SAP GUI Window Control ALV Tree Calendar New recording component Action leads to local processing in SAP GUI Action leads to event handler on application server TCD Recorder e. CATT Application Logic SAP AG 2005, Title of Presentation / Speaker Name / 73

Introducing GUI Scripting host in GUI (Requires SAP GUI 6. 20) e. CATT at Introducing GUI Scripting host in GUI (Requires SAP GUI 6. 20) e. CATT at backend ã SAP AG 2005, Title of Presentation / Speaker Name / 74

Recording the SAPGUI Command – Procedure 1. Select SAPGUI(Record) 2. Set the scripting granularity Recording the SAPGUI Command – Procedure 1. Select SAPGUI(Record) 2. Set the scripting granularity ã SAP AG 2005, Title of Presentation / Speaker Name / 75

Recording the SAPGUI Command - Procedure 3. Confirm that you want to record 4. Recording the SAPGUI Command - Procedure 3. Confirm that you want to record 4. Pick the relevant initial states to record ã SAP AG 2005, Title of Presentation / Speaker Name / 76

Scripting Granularity Action Action Action Action Action Action Session Transaction Screen T: New Transaction Scripting Granularity Action Action Action Action Action Action Session Transaction Screen T: New Transaction ã SAP AG 2005, Title of Presentation / Speaker Name / 77 S: New Screen S T S

Making Sense of the Command Interface - 1 One Processed. Screen node per screen Making Sense of the Command Interface - 1 One Processed. Screen node per screen User. Changed. State describes the user actions on the screen ã SAP AG 2005, Title of Presentation / Speaker Name / 78

Parameterizing an Input Value Field name Enter parameter name in this field Double-click ã Parameterizing an Input Value Field name Enter parameter name in this field Double-click ã SAP AG 2005, Title of Presentation / Speaker Name / 79

Recording the SAPGUI Command – Initial State ã SAP AG 2005, Title of Presentation Recording the SAPGUI Command – Initial State ã SAP AG 2005, Title of Presentation / Speaker Name / 80

Active and Inactive Checks Active Checks n Record the initial states of the selected Active and Inactive Checks Active Checks n Record the initial states of the selected screen element types n On replay, check that the values in the fields correspond to the recorded initial states Inactive Checks n Record the initial states of the selected screen element types so that they can be placed into script parameters and used in the rest of the script ã SAP AG 2005, Title of Presentation / Speaker Name / 81

Making Sense of the Command Interface - 2 One Initial. State node per processed Making Sense of the Command Interface - 2 One Initial. State node per processed screen Are checks active? Field name Field value during recording ã SAP AG 2005, Title of Presentation / Speaker Name / 82

Retrieving an Output Value Double-click ã SAP AG 2005, Title of Presentation / Speaker Retrieving an Output Value Double-click ã SAP AG 2005, Title of Presentation / Speaker Name / 83 Enter parameter name in this field

Activating and Deactivating Field Checks ã SAP AG 2005, Title of Presentation / Speaker Activating and Deactivating Field Checks ã SAP AG 2005, Title of Presentation / Speaker Name / 84

Message Handling – MESSAGE Stipulate that certain messages must/must not occur in order for Message Handling – MESSAGE Stipulate that certain messages must/must not occur in order for the script to be a success Find out what messages occurred during a particular block of SAPGUI commands ã SAP AG 2005, Title of Presentation / Speaker Name / 85

Message Handling - ENDMESSAGE MIDX MODE MSGTYP MSGID MSGNR <n> F E ECDEMO 003 Message Handling - ENDMESSAGE MIDX MODE MSGTYP MSGID MSGNR F E ECDEMO 003 2 A E A S MSGV 2 LH MSGV 3 MSGV 4 0400 ECDEMO 021 3 MSGV 1 XY 100 E_MSG_1[1]-MIDX contains the total number of messages in the table ã SAP AG 2005, Title of Presentation / Speaker Name / 86

Creating Rules in the MESSAGE Statement Rule = What to do + Message qualification Creating Rules in the MESSAGE Statement Rule = What to do + Message qualification What to do Mode R: E: A: F: Message qualification Require Expect Allow Fail Message Type Any combination of Exit ã Continue processing or jump directly to ENDMESSAGE? SAP AG 2005, Title of Presentation / Speaker Name / 87 Message Class Message Number

Some Sample Message Rules “Tolerate all error messages” Mode 'A' Exit MSGTYP 'E' ID Some Sample Message Rules “Tolerate all error messages” Mode 'A' Exit MSGTYP 'E' ID Number “Fail script and jump to ENDMESSAGE on error message ZJM 001” Mode 'F' ã Exit 'X' MSGTYP ID Number 'E' 'ZJM' '001' SAP AG 2005, Title of Presentation / Speaker Name / 88

Default Message Handling Rules User-defined Rules Allow Fail and Exit ã Success Information messages Default Message Handling Rules User-defined Rules Allow Fail and Exit ã Success Information messages Warning Error Termination messages Dump SAP AG 2005, Title of Presentation / Speaker Name / 89

Message Processing Look up in user-defined rules Look up in default rules New Message Message Processing Look up in user-defined rules Look up in default rules New Message Discard Process according to rule ã SAP AG 2005, Title of Presentation / Speaker Name / 90 Process according to rule

The SAPGUI Command Interface 4 System Information ã SAP AG 2005, Title of Presentation The SAPGUI Command Interface 4 System Information ã SAP AG 2005, Title of Presentation / Speaker Name / 91

Activating and Deactivating Screens Active = ‘X’: Screen active Active = ‘ ’: Screen Activating and Deactivating Screens Active = ‘X’: Screen active Active = ‘ ’: Screen inactive Active = ‘O’: Screen optional Screen 1 Screen 2 Screen 3 “Join” OK? ã SAP AG 2005, Title of Presentation / Speaker Name / 92

Troubleshooting in the SAPGUI Command Set automation queue behavior Run commands with stops at Troubleshooting in the SAPGUI Command Set automation queue behavior Run commands with stops at various granularity levels Close GUI sessions or leave them open for inspection ã SAP AG 2005, Title of Presentation / Speaker Name / 93

Unit Summary In this unit, you learned: n Why the TCD driver is not Unit Summary In this unit, you learned: n Why the TCD driver is not suitable for testing all transaction types n How GUI Scripting works n How to use the e. CATT SAPGUI command to record a transaction n How to set input fields, read output fields, and perform field checks in a SAPGUI recording n How to activate and inactivate screens in a script, and the things that you have to consider when doing so ã SAP AG 2005, Title of Presentation / Speaker Name / 94

Unit 7: Testing Transactions - III Testing Web- and Desktop-based Applications Using an External Unit 7: Testing Transactions - III Testing Web- and Desktop-based Applications Using an External Tool

Unit Objectives In this unit, you will learn: n When to use TCD and Unit Objectives In this unit, you will learn: n When to use TCD and SAPGUI, and when you have to use an external tool n Why SAP chose to work with external tools n The advantages of the external tool integration n How the integration works ã SAP AG 2005, Title of Presentation / Speaker Name / 96

Choosing the Right Driver Is the application a function module or BAPI? ã SAP Choosing the Right Driver Is the application a function module or BAPI? ã SAP AG 2005, Title of Presentation / Speaker Name / 97 No Does the application run under SAP GUI for Windows or Java? No Use ext. tool

Configuring The System for an External Tool Run function module SET_EXTERNAL_TOOL in test mode Configuring The System for an External Tool Run function module SET_EXTERNAL_TOOL in test mode Run program ECATT_GENERATE_ET_USER to generate service user Regenerate authorizations in role SAP_ECET ã SAP AG 2005, Title of Presentation / Speaker Name / 98

External Tool Integration - Architecture Application Server Database e. CATT Script with Attributes Scripts External Tool Integration - Architecture Application Server Database e. CATT Script with Attributes Scripts stored in SAP database Physical script commands Application Under Test Frontend External Tool ã SAP AG 2005, Title of Presentation / Speaker Name / 99

Using Compuware Test. Partner to Record a Script Checks VBA Functionality Parameterization Recording ã Using Compuware Test. Partner to Record a Script Checks VBA Functionality Parameterization Recording ã SAP AG 2005, Title of Presentation / Speaker Name / 100

Passing Arguments To and From Test. Partner – Argument Container e. CATT Argument Container Passing Arguments To and From Test. Partner – Argument Container e. CATT Argument Container Script Test. Partner ã SAP AG 2005, Title of Presentation / Speaker Name / 101

Passing Arguments To and From Test. Partner – Script Coding Argument Container Name Type Passing Arguments To and From Test. Partner – Script Coding Argument Container Name Type Direction . . . I_Name String IMPORT . . . E_Value String IMPORT . . . Sub Main () Dim Import. Param As String, Export. Param As String Import. Param = Get. Ecatt. Arg("I_NAME"). . . Set. Ecatt. Arg "E_VALUE", Export. Param End Sub Script: VBA Coding ã SAP AG 2005, Title of Presentation / Speaker Name / 102

Uploading Scripts Projects for upload Script name and version Administrative settings ã SAP AG Uploading Scripts Projects for upload Script name and version Administrative settings ã SAP AG 2005, Title of Presentation / Speaker Name / 103

Calling External Scripts REFEXT ( SCRIPT, INTERFACE, VERSION ). ã SAP AG 2005, Title Calling External Scripts REFEXT ( SCRIPT, INTERFACE, VERSION ). ã SAP AG 2005, Title of Presentation / Speaker Name / 104

Unit Summary In this unit, you have learned: n When to use TCD and Unit Summary In this unit, you have learned: n When to use TCD and SAPGUI, and when you have to use an external tool n Why SAP chose to work with external tools n The advantages of the external tool integration n How the integration works ã SAP AG 2005, Title of Presentation / Speaker Name / 105

Unit 8: Building Executable Tests Calling Other Test Objects Test Configurations and Test Data Unit 8: Building Executable Tests Calling Other Test Objects Test Configurations and Test Data Containers The Test Workbench

Unit Objectives In this unit, you will learn: n How you can modularize tests Unit Objectives In this unit, you will learn: n How you can modularize tests at script level n The difference between a test script and a test configuration n How to create test configurations n How to manage test data ã SAP AG 2005, Title of Presentation / Speaker Name / 107

Modularization at Script Level There are two reasons for modularization: n To split up Modularization at Script Level There are two reasons for modularization: n To split up parts of a process into separate e. CATT scripts to increase the possibility of reusing them n To allow the integration of non-e. CATT objects, that is u. External scripts u. Existing CATT procedures ã SAP AG 2005, Title of Presentation / Speaker Name / 108

REF Scripts can call other scripts: REF ( SCRIPT, INTERFACE, [TARGET]). Create Order REF REF Scripts can call other scripts: REF ( SCRIPT, INTERFACE, [TARGET]). Create Order REF ATP Check REF REF Manufacturing Billing ã SAP AG 2005, Title of Presentation / Speaker Name / 109

REFCATT From e. CATT, you can call CATT procedures residing in the same system: REFCATT From e. CATT, you can call CATT procedures residing in the same system: REFCATT ( CATT, INTERFACE, [TARGET] ). REFCATT ( CATT, INT, TGT ). CATT Procedure ã SAP AG 2005, Title of Presentation / Speaker Name / 110 TGT

REMOTECATT You can also call CATT procedures that reside in a remote system: REMOTECATT REMOTECATT You can also call CATT procedures that reside in a remote system: REMOTECATT ( CATT, INTERFACE, TARGET ). REFCATT ( CATT, INT, TGT ). CATT Procedure in TGT ã SAP AG 2005, Title of Presentation / Speaker Name / 111 EXE

Test Configuration Data - Variants Importing Parameters Command <interface>, Script ã SAP AG 2005, Test Configuration Data - Variants Importing Parameters Command , Script ã SAP AG 2005, Title of Presentation / Speaker Name / 112 . System mapping System data container

Manual Variants Quick entry for a few variants Cut and paste possible from delimited Manual Variants Quick entry for a few variants Cut and paste possible from delimited text file (Excel) Variants bound to a single configuration – not reusable ã SAP AG 2005, Title of Presentation / Speaker Name / 113

Reusing Test Data: Test Data Containers Variants Test data container Importing Parameters Command <interface>, Reusing Test Data: Test Data Containers Variants Test data container Importing Parameters Command , Script ã SAP AG 2005, Title of Presentation / Speaker Name / 114 . System mapping System data container

Test Data Container Parameters Name Value Airline LH Date Ref System S_CARR_ID ABAP Type Test Data Container Parameters Name Value Airline LH Date Ref System S_CARR_ID ABAP Type Length D 8 Variants Variant Var 1 Var 2 ã Description Data SAP AG 2005, Title of Presentation / Speaker Name / 115 Airline AA LH Date 01. 04. 2002

Managing Test Data 1 Test Script Parameters P 1 P 2 P 3 ã Managing Test Data 1 Test Script Parameters P 1 P 2 P 3 ã Test Data Container Parameters P 1 P 2 P 3 SAP AG 2005, Title of Presentation / Speaker Name / 116

Managing Test Data 2 Test Script Parameters P 1 P 2 P 3 Parameters Managing Test Data 2 Test Script Parameters P 1 P 2 P 3 Parameters P 1 P 4 P 5 Parameters P 2 P 5 P 6 Test Data Container Parameters P 1, P 2, P 3, P 4, P 5, P 6 ã SAP AG 2005, Title of Presentation / Speaker Name / 117

Managing Test Data 3 Test Script 20 Parameters 15 Parameters 24 Parameters Test Data Managing Test Data 3 Test Script 20 Parameters 15 Parameters 24 Parameters Test Data Container Parameter Group 1 ã Test Data Container Parameter Group 2 Parameter Group n SAP AG 2005, Title of Presentation / Speaker Name / 118 . . .

Variant Wizard Start variant wizard Test Data Container Variants ã SAP AG 2005, Title Variant Wizard Start variant wizard Test Data Container Variants ã SAP AG 2005, Title of Presentation / Speaker Name / 119 Configuration Variants

Managing Test Data - Example I_CARRID I_CONNID I_FLDATE I_FARE I_CURR I_TYPE I_MAX_B. . . Managing Test Data - Example I_CARRID I_CONNID I_FLDATE I_FARE I_CURR I_TYPE I_MAX_B. . . LH 0400 20030101 600 EUR 747 250 40 LH 0400 20030102 750 EUR 747 250 40 LH 0400 20030103 600 EUR 747 250 40 QF 0006 20030101 1500 AUD 747 250 40 QF 0006 20030102 1850 AUD 747 250 40 ã SAP AG 2005, Title of Presentation / Speaker Name / 120

Managing Test Data - Example Test Data Container Test Configuration AIRLINES Maximize reuse Minimize Managing Test Data - Example Test Data Container Test Configuration AIRLINES Maximize reuse Minimize redundancy Test Data Container AIRCRAFT ã SAP AG 2005, Title of Presentation / Speaker Name / 121 Data for a particular test case

Modularization at Test Organizer Level Test Catalog Test Plan User Test Package Test Configuration Modularization at Test Organizer Level Test Catalog Test Plan User Test Package Test Configuration ã SAP AG 2005, Title of Presentation / Speaker Name / 122

Unit Summary In this unit, you have learned: n How you can modularize tests Unit Summary In this unit, you have learned: n How you can modularize tests at script level n The difference between a test script and a test configuration n How to create test configurations n How to manage test data ã SAP AG 2005, Title of Presentation / Speaker Name / 123

Unit 9: Advanced Topics Versioning of Scripts Migrating CATT Procedures Unit 9: Advanced Topics Versioning of Scripts Migrating CATT Procedures

Unit Objectives In this unit, you will learn n Why script versioning is necessary Unit Objectives In this unit, you will learn n Why script versioning is necessary n How to create different versions of a script n How the system picks the correct version of a script for execution n How to migrate CATT procedures to e. CATT ã SAP AG 2005, Title of Presentation / Speaker Name / 125

Versioning For different implementations of the same test (for example, transaction with / without Versioning For different implementations of the same test (for example, transaction with / without controls), you can create different versions of the same script. ã SAP AG 2005, Title of Presentation / Speaker Name / 126

How Versioning Works Test Configuration Script EC_DEMO Sys. Data EC_DEMOSYSTEMS Target Sys. R 3 How Versioning Works Test Configuration Script EC_DEMO Sys. Data EC_DEMOSYSTEMS Target Sys. R 3 Release? 4. 6 C R/3 Rel. 4. 6 C ã Version 1: SAP_APPL 46 C SAP AG 2005, Title of Presentation / Speaker Name / 127 Version 2: SAP_APPL 470

Specifying the Validity of a Version Target System ã SAP AG 2005, Title of Specifying the Validity of a Version Target System ã SAP AG 2005, Title of Presentation / Speaker Name / 128

Backup Versions Version 1 SAP_BASIS 610 Version 2 SAP_BASIS 620 Backup Version 3 SAP_BASIS Backup Versions Version 1 SAP_BASIS 610 Version 2 SAP_BASIS 620 Backup Version 3 SAP_BASIS ã SAP AG 2005, Title of Presentation / Speaker Name / 129 620

Migration Test System CATT Module Target System ‘X’ CATT Module e. CATT Migration Function Migration Test System CATT Module Target System ‘X’ CATT Module e. CATT Migration Function New e. CATT Script With target system X ã SAP AG 2005, Title of Presentation / Speaker Name / 130

Migrating Variants Test System New e. CATT Script Target System ‘X’ with target system Migrating Variants Test System New e. CATT Script Target System ‘X’ with target system X CATT Module Script Target System X Variants Test Configuration ã SAP AG 2005, Title of Presentation / Speaker Name / 131 Variants

Recursive Migration Test System New e. CATT Script Target System ‘X’ with target system Recursive Migration Test System New e. CATT Script Target System ‘X’ with target system X REF… CATT Module REF… New e. CATT Script with target system X ã SAP AG 2005, Title of Presentation / Speaker Name / 132 CATT Module

Unit Summary In this unit, you have learned n Why script versioning is necessary Unit Summary In this unit, you have learned n Why script versioning is necessary n How to create different versions of a script n How the system picks the correct version of a script for execution n How to migrate CATT procedures to e. CATT ã SAP AG 2005, Title of Presentation / Speaker Name / 133

Course Summary In this course, you have learned n What and when you need Course Summary In this course, you have learned n What and when you need to test in the SAP Solution Lifecycle n The advantages of e. CATT for testing SAP systems compared with other automated test tools n How to set up your system environment for testing with e. CATT n How to create test cases to test various different kinds of SAP applications n How to create executable tests, and how these can be managed using the SAP Test Workbench n How to migrate CATT objects to e. CATT ã SAP AG 2005, Title of Presentation / Speaker Name / 134