Professional Documents
Culture Documents
Unit Objectives
In this unit, you will learn:
How a finished eCATT test case is put together The different object types used in eCATT How to set up a system for use with eCATT Some of the security aspects that you need to consider
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 2003, PDECAT 2003/2, JM/ 5
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 2003, PDECAT 2003/2, JM/ 6
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.
Unit Summary
In this unit, you have learned
The different object types with which you work in eCATT How these object types support you in the various stages of planning an automated test project How to set up a system to enable eCATT How to define secure RFC destinations How to create a system data container
Unit Objectives
In this unit you will learn:
The structure of an eCATT script The essential features of the eCATT script editor The main aspects of the eCATT scripting language How to work with parameters
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
Simple Parameters
Creation
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.
Unit Summary
In this unit, you have learned
The various areas of the eCATT Test Script Editor The features of the eCATT script language How to create eCATT parameters How to use the pattern function in the eCATT Script Editor Which driver to use for various kinds of applications
Unit Objectives
In this unit you will learn:
How to test function modules and BAPIs How to read from and test against the database How to use blocks of ABAP coding to enhance your test scripts
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 2003, PDECAT 2003/2, JM/ 35
Unit Summary
In this unit you have learned:
How to test function modules and BAPIs How to read from and test against the database How to use blocks of ABAP coding to enhance your test scripts
Unit Objectives
In this unit you will learn:
What transactions are suitable for testing using the TCD command How to record a transaction using the TCD command 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
It allows you to record a transaction, parameterize its input fields, and read or set checks against its output fields
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
Field
Field
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 ).
Unit Summary
In this unit you have learned:
What transactions are suitable for testing using the TCD command How to record a transaction using the TCD command How to set input fields, read output fields, and perform fields checks with the TCD command
Unit Objectives
In this unit, you will learn:
Why the TCD driver is not suitable for testing all transaction types How GUI Scripting works How to use the eCATT SAPGUI command to record a transaction How to set input fields, read output fields, and perform field checks in a SAPGUI recording
No
Does the application run under SAP GUI for Windows or Java?
Use SAPGUI
SAP AG 2003, PDECAT 2003/2, JM/ 55
Frontend
Backend
TCD Recorder
eCATT Application Logic
eCATT at backend
1. Select SAPGUI(Record)
Scripting Granularity
Transaction
Screen Separate Command Separate Command
Screen
Screen
Separate Command
Separate Command
Screen
Separate Command
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
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 2003, PDECAT 2003/2, JM/ 75
Unit Summary
In this unit, you learned:
Why the TCD driver is not suitable for testing all transaction types How GUI Scripting works How to use the eCATT SAPGUI command to record a transaction How to set input fields, read output fields, and perform field checks in a SAPGUI recording How to activate and inactivate screens in a script, and the things that you have to consider when doing so
Unit Objectives
In this unit, you will learn:
When to use TCD and SAPGUI, and when you have to use an external tool Why SAP chose to work with external tools The advantages of the external tool integration How the integration works
No
Does the application run under SAP GUI for Windows or Java?
No
eCATT
Script with Attributes
Frontend
External Tool
SAP AG 2003, PDECAT 2003/2, JM/ 82
Checks
VBA Functionality
Parameterization
Recording
eCATT
Argument Container
Script TestPartner
SAP AG 2003, PDECAT 2003/2, JM/ 84
Uploading Scripts
Projects for upload
Administrative settings
Unit Summary
In this unit, you have learned:
When to use TCD and SAPGUI, and when you have to use an external tool Why SAP chose to work with external tools The advantages of the external tool integration How the integration works
RFC Destinations
Application URL http://<Target Host>:<Service No.>/<URL Extension>/<Application>
ABAP Stack: Connection Type H Java Stack: Connection Type G
Parameterizing Fields
Read values under SCREEN nodes Check values under SCREEN nodes Set values under:
DATACHANGES nodes ACTIONS nodes
Getting and checking can be done using the context menu or simulator
Start Options
Background Foreground
Error mode starts and background and only changes to foreground in case of error
ABAP Objects
New Commands in Release 6.40 For Public Static Members
CALLSTATIC ( <CLASS>, <STATIC METHOD>, <COMMAND INTERFACE>). GETSTATIC ( <CLASS>, <STATIC ATTRIBUTE>, <PARAMETER> ).
SETSTATIC ( <CLASS>, <STATIC ATTRIBUTE>, <PARAMETER> ). CHESTATIC ( <CLASS>, <STATIC ATTRIBUTE>, <PARAMETER> ).
External Variants
The contents of a test data container or test configuration can be downloaded as a text file (XML format also planned) External data can be uploaded from external files into test data containers or test configurations It is also possible for a test configuration or test data container not to contain any internal variants, but to point to a text or XML file on the frontend, from which the variants are read dynamically at runtime
Test Configuration
Upload variants
Text File
Execute
Test Configuration
Execute
Start Options Use external variants Confirm path to variants
Upload variants
Text File
BC Set Original
Transport
BC Set Copy
DEV
QAS
CTS
Web AS 6.40
SAP AG 2003, PDECAT 2003/2, JM/ 103
Variables
E Check existence
Executed commands
Current command
Parameter List
SAP AG 2003, PDECAT 2003/2, JM/ 105
Script-Wide Search
A script-wide search function (Ctrl + F)
SE80 Integration
There are two new views within the Object Navigator:
The Object Navigator shows you the test objects that belong to a particular package
The Test Repository shows you the test objects that belong to a particular application component
Versioning Enhancements
A new graphical tool for managing the validity of all script versions centrally Choose Utilities -> Version Management -> Display | Change from transaction SECATT Features:
Overview of all versions of a script Maintain validity
Set Backup flag Simulation of version determination on the basis of a given target system
Versioning Enhancements
Usability Improvements 1
Automatic parameter creation
When you enter an undeclared parameter name in a command interface, eCATT asks you if you want it to be created
Copying of parameters and/or command interfaces Edit -> Parameter/Command Interfaces-> Import
From one script to another From a script to a test data container From a test data container to a script
Usability Improvements - 2
Automatic Test Configuration Creation Utilities -> Test Configuration -> Create
Creates a new configuration based on the current script and system data container
sapgui/user_scripting_set_readonly
If this parameter is set to TRUE, scripts can only contain read-only operations
Double-click
CHEGUI allows you to perform a check against a certain value as well as retrieving the actual value in the field at runtime