Professional Documents
Culture Documents
VSDK 3.0
Prerequisites
Experience of software testing An understanding of the architecture of the SAP Web Application Server (as provided in course SAPTEC)
Contents
Occasions for Testing New SAP installations Addition and integration of new components In-house developments
Functional Tests Integration tests with other components
lab space to work in Be trained Be released from their other duties (internal) or bought-in (external)
Is time-consuming Offers little potential for reuse of test resources But does have the advantage that manual testers spot errors and issues that are beyond the scope of the test plan
Automated Testing
Requires fewer people and resources Execution takes less time Parameterization of fields allows replay with any number of different sets of values Offers considerable possibilities for reusing test scripts Makes it easier to reproduce errors that occur during testing
SAP AG 2005, Title of Presentation / Speaker Name / #
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
If it doesn't have to be repeatable, it doesn't necessarily have to be automated 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!
Choosing an Automated Test Tool External Tools Classic automated test tools can test an SAP System by driving the SAP GUI...
Automated Test Tool Frontend SAPGUI Window
Script
Backend
Choosing an Automated Test Tool SAP CATT CATT Computer Aided Test Tool Available from Release 3.0 Advantages
Shipped free with SAP Basis System Most effective testing method for SAP transactions
Disadvantages
Control technology not fully supported
No support for tabular parameters of function modules Only limited support for distributed system environments Only limited support for external applications
Choosing an Automated Test Tool - SAP eCATT The Extended Computer Aided Test Tool (eCATT) is the successor to SAPs CATT. Its design aims were to
Enable as many SAP transactions as possible to be tested automatically
Provide a simplified concept for testing in a complex system landscape Allow reuse of test data by storing it in separate container objects
eCATT is available with Release 6.20 of the SAP Web Application Server With it, you can remotely test any mySAP.com solution that is running R/3 Basis Release 4.6C or higher
(see note 519858 for details of required support packages)
What Applications Can Be Tested Using eCATT? . . . Using Built-In eCATT Means
Transactions in SAP GUI for Windows
Web-based Transactions
Desktop-based transactions
SAP AG 2005, Title of Presentation / Speaker Name / #
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
What Systems Can Be Tested Using eCATT? 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
eCATT
CRM
Web AS 6.20
APO
applications that you can test with it system landscape in which you can test
A Finished Example
Test Configuration
Test Instructions
Archive
Results
Test Script
The set of commands that forms the test
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 / #
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?
System data container Test data container
1 2
4 3
Test script
5
Test Workbench
Client Settings
In each client in which you want to test, you must ensure that the CATT/eCATT flag is set to allow tests to run
GUI Scripting
In order to use the new GUI Scripting functions, the following settings have to be made:
Profile SAP
GUI must be Version 6.20 with patch level =>18 and GUI Scripting installed
1. 2. eCATT 3. 4.
Web AS 6.20
Test CRM transaction Check table entries in R/3 Run transaction in R/3 Call function module in APO
RFC
CRM
R/3
APO
Business Process
SAP AG 2005, Title of Presentation / Speaker Name / #
Source System
RFC Destination Client: Lang: User: Pwd: 100 EN tester letmein
Target System
Target Transaction
Test Script System Data Container Command With Logical Target 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.
Target system
. . .
. . .
R3
Reuse
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.
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.
Structure of a Script
Test Script
Attributes
Parameters Importing
Exporting
Local variables
Commands
Script Attributes
Parameter List
Command Editor
Structure Editor
Structured Parameters
I_ITAB[2]-CONNID = '0400'.
GETLEN ( I_ITAB, VAR ).
Script Language
Conditions
Checks
Loops
Calculations
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 eCATT
No
Does the application run under SAP GUI for Windows or Java?
No
Yes
Use FUN
No
Use TCD
No
Yes
Use SAPGUI
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
Pattern Function The Pattern function is similar to the statement pattern in the ABAP Editor. It allows you to build individual eCATT commands. A command consists of:
The command keyword
Argument (the target object) Interface (parameters that need to be passed) Target system
Command Interface Most eCATT commands have a command interface, which corresponds to:
The interface of a function module (for FUN) The screen and field structure of a transaction (for TCD) A list of user interactions (for SAPGUI) 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.
Yes
Use FUN
Transaction
Function Module
Function Module
Function Module
Transaction
Command Interface
Importing
Exporting Changing
Tables
Function Module
Exceptions
or
INTERFACE-IMPORTING-PARAMETERNAME = value. INTERFACE-IMPORTING-STRUCTURE-FIELDNAME = value. INTERFACE-TABLES-TABLE[idx]-FIELDNAME = value.
Trapping Exceptions
Interface
Exceptions DATA_INCOMPLETE CREATE_FAILED
Interface
Exceptions
DATA_INCOMPLETE CREATE_FAILED
Table Operations
Test Script
GETTAB ( TAB, INTF, [DEST] ). CHETAB ( TAB, INTF, [DEST] ). SETTAB ( TAB, INTF, [DEST] ). RESTAB ( TAB, [DEST] ).
Database
Application Table
Customizing Table
Value <INITIAL>
I/E/V V
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 / #
How to set input fields, read output fields, and perform fields checks with the TCD command
No
Does the application run under SAP GUI for Windows or Java?
No
Use TCD
No
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
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 eCATT
Same system
Different system
ENTER
Field values FIELD VBAK-AUART VBAK-VKORG . . . BDC_OKCODE VALUE AF 1000 ENT2 Function code FIELD KUAGV-KUNNR VBAP-MATNR . . . BDC_OKCODE VALUE 1280 P-103 SICH
Transaction
Field
Field
Parameterizing Input Fields You can replace the recorded values with either literals or variables
Field name Double-click Value
Read a value
'G' 'C'
Check a value
Message Handling
Location of message
(program and screen)
Message attributes
MSG
Internal Table
Message variables
(up to four)
Testing Messages
Require that a particular message is sent ON_LAST_MESSAGE_CHECK ( 031 ). TCD ( EC_TUTORIAL_TCD, EC_TUTORIAL_TCD_1 ).
How to set input fields, read output fields, and perform fields checks with the TCD command
No
Does the application run under SAP GUI for Windows or Java?
Use SAPGUI
SAP AG 2005, Title of Presentation / Speaker Name / #
Frontend
Backend
TCD Recorder
eCATT Application Logic
eCATT at backend
1. Select SAPGUI(Record)
Scripting Granularity
Action
Action
S
Action Action Action S Action Action Transaction T: New Transaction
SAP AG 2005, Title of Presentation / Speaker Name / #
Action
Action
Session
Field name
Double-click
Inactive Checks
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
Field name
Double-click
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
MIDX <n> 2 3
MODE F A A
MSGTYP E E S
MSGV1 LH
MSGV2 0400
MSGV3
MSGV4
E_MSG_1
Message qualification
Message Type Message Class
Mode
Exit
Message Number
Mode 'A'
Exit
MSGTYP 'E'
ID
Number
Mode 'F'
Exit 'X'
MSGTYP 'E'
User-defined Rules
Allow
Message Processing
Discard
System Information
Screen 1
Screen 2
Screen 3
Join OK?
SAP AG 2005, Title of Presentation / Speaker Name / #
No
Does the application run under SAP GUI for Windows or Java?
No
eCATT
Script with Attributes
Frontend
External Tool
SAP AG 2005, Title of Presentation / Speaker Name / #
Checks
VBA Functionality
Parameterization
Recording
eCATT
Argument Container
Script TestPartner
SAP AG 2005, Title of Presentation / Speaker Name / #
Uploading Scripts
Projects for upload
Administrative settings
Calling Other Test Objects Test Configurations and Test Data Containers The Test Workbench
REF Scripts can call other scripts: REF ( SCRIPT, INTERFACE, [TARGET]).
Create Order
Billing
REFCATT From eCATT, you can call CATT procedures residing in the same system: REFCATT ( CATT, INTERFACE, [TARGET] ).
CATT Procedure
SAP AG 2005, Title of Presentation / Speaker Name / #
TGT
REMOTECATT You can also call CATT procedures that reside in a remote system: REMOTECATT ( CATT, INTERFACE, TARGET ).
EXE
Test Configuration
Data - Variants
Importing Parameters
System mapping
Script
SAP AG 2005, Title of Presentation / Speaker Name / #
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
Variants
Importing Parameters
System mapping
Script
SAP AG 2005, Title of Presentation / Speaker Name / #
Parameters
Name Value Airline LH Date Ref System S_CARR_ID ABAP Type Length D 8
Variants
Variant Var1 Var2 Description Data Data Airline AA LH Date 01.04.2002 01.04.2002
Test Script
Parameters P1 P2 P3
Test Script
Parameters P1 P2 P3
Test Script
Parameters P1 P4 P5
Test Script
Parameters P2 P5 P6
Test Script
20 Parameters
Test Script
15 Parameters
Test Script
24 Parameters
...
Parameter Group n
Variant Wizard
Configuration Variants
Variants
I_CARRID I_CONNID I_FLDATE I_FARE I_CURR I_TYPE I_MAX_E I_MAX_B... LH LH LH QF QF 0400 0400 0400 0006 0006 20030101 20030102 20030103 20030101 20030102 600 750 600 1500 1850 EUR EUR EUR AUD AUD 747 747 747 747 747 250 250 250 250 250 40 40 40 40 40
Test Configuration
Maximize reuse
Minimize redundancy Test Data Container AIRCRAFT
SAP AG 2005, Title of Presentation / Speaker Name / #
Test Catalog
Test Plan
User
Test Package
Test Configuration
Test Configuration
How the system picks the correct version of a script for execution
How to migrate CATT procedures to eCATT
Versioning For different implementations of the same test (for example, transaction with / without controls), you can create different versions of the same script.
Test Configuration
Script Sys. Data Target Sys.
EC_DEMO EC_DEMOSYSTEMS
Version 2: SAP_APPL 470
R3
Release?
4.6C
R/3
Rel. 4.6C
Target System
Backup Versions
Version 1
SAP_BASIS 610
Version 2
SAP_BASIS Backup 620
Version 3
SAP_BASIS 620
Migration
Test System
CATT Module
Target System X
CATT Module
Migrating Variants
Test System
New eCATT Script
with target system X
Target System X
CATT Module
Variants
Recursive Migration
Test System
New eCATT Script
with target system X
Target System X
CATT Module REF REF
REF REF
CATT Module
CATT Module
How the system picks the correct version of a script for execution
How to migrate CATT procedures to eCATT