eCATT Introduction : eCATT provides a environment for developing functional tests. eCATT creates a single object that defines every aspect of a test, has four separate object types. The first three form the building blocks of a test, and the fourth combines the others into a complete test case. eCATT Objects : •
Test Script • Set of commands that form the test
•
Test Data Container • Reusable sets of parameters that can be used to run tests
•
System Data Container • A list of systems that are addressed during the execution of a test script
•
Test Configuration • A Test Script, plus data from one or more Test Data Containers, plus a System Data Container that describes the system landscape.
Transaction Code For Using eCATT:
Choose SAP menu-> Test->Test WorkbenchExte->CATT->nded CATT. Transaction code – SECATT
Ways Of Doing Testing In eCATT:
eCATT enables to test all SAP applications. There are four different drivers available in eCATT for this testing purpose as follows – •
Non-User Interface: •
•
TCD: •
•
Suitable for testing transactions (especially who don’t involve activex controls), load testing. Doesn’t require GUI for playback, so offers maximum speed for testing.
SAPGUI Scripting: •
•
Suitable for testing backend R/3 specific modules like function modules & BAPIs, Interfaces testing in mySAP environment, load testing.
Suitable for testing transactions, who involve activex controls. Requires GUI for playback & hence very slow. Not suitable for load testing.
Interface To External Tools: •
External products, which are certified against BC-eCATT Interface, can be tested who run under GUIs (Other than SAP GUI for Windows & SAP GUI for JAVA) using eCATT.
Main focus of this document is to test the business process by recording the set of transaction code thro TCD.
Steps Involved In Creation Of eCATT Test Scripts:
1. Test script is series of steps (transactions) involving a business scenario. 2. Recording of test script by selecting proper recording mode. 3. Execution of test script immediately after recording without parameterization to confirm the errorless recording. 4. Parameterization of the import, export & variable parameters. 5. Preparing variants using Test Data Container. 6. Linking Test Script (TS) & Test Data Container (TD) by Test Configuration (TC). 7. Execution of TS using TC for different Variants.
The test script editor has the following areas: 1. Application Toolbar 2. Information Area 3. Editor tab
Parameter List Command Editor Structure Editor
4. Attribute tab Application Toolbar
Information Area
Parameter List
Command Editor Structure Editor
Steps for recording the eCATT Using TCD Mode : 1. Give the name of the Test Script (TS) in Test Script input box. The Version input by default is with value 1.
2. In the Attributes ->General Data Tab, the value of the Component will be BC-TWB-TST-ECA for eCATT.
3. In the test script editor, choose the Editor tab. 4. Choose Pattern button from the application toolbar. 5. The Insert Statement dialog box appears. 6. From the Group dropdown list choose UI Control,
Then in Command Dropdown List, choose TCD (Record). 7. In the Transaction field, enter the transaction code of the transaction that you want to record, and choose Enter. 8. In the Interface field, a system-generated name appears. 9. Accept the system-generated name or edit it. 10. If there is a system data container, you can enter the target system in the Target System field. 11. Choose Enter. The transaction starts recording.
12. Work through the transaction as normal. When you leave the transaction, the system returns you to the script editor with the Recording ended dialog box. 13. Choose Yes to transfer the data. A TCD command and its associated Command Interface will be inserted in test script editor of SECATT.
TCD Command in the Command Editor
Before proceeding to next step , here you can execute the script thro the execute button on the application toolbar (F8), to check the recording done is working error free. The log is displayed giving the outcome of the execution of the transaction.
After the confirmation of the error free execution, we can now proceed for parameterization.
What are Parameters : Parameters are imports ,exports or local variables:•
Import Parameters (IP): Import parameters are input values to the script. They are passed to the script during execution. They are locally available and test script version independent. Import parameters can hold default value also.
•
Export Parameters (EP): Export parameters are outcome of the test script execution. The result value is passed into the export parameter when the test returns from the test module. They are test script version independent.
•
Local Variables (LV): Local variables are used in test scripts for calculations, or to receive export parameters from referred test cases or called function modules. They are also used for passing values to and from inline ABAP blocks & are versiondependent – that is, a local variable defined in one version is not automatically defined in another version.
Parameter name can be 30 char long, it should begin with charcter or a underscore.
In TCD mode , on double clicking the interface name in the command editor the parameter list displays the interface details .
Command Interface value on the structure editor
Defining Import Parameters: For parameterization, select the Dynpro whose fields need to be parameterized as Import/Export parameter. Click on Screen Simulation icon of the command interface.
Screen Simulator
On clicking the screen simulator, it navigates to the screen, where each field can be parameter by clicking on the “insert import parameter” by placing the cursor on the field which needs to be parameterized .
Eg of screen simulator :
Insert import parameter button
One Maintain field entry window appears for the selected field with its technical name. Give the parameter name & default value in the Field contents there. Press enter. The parameter will be inserted into the parameter list. Click on Back (F3) button of the standard toolbar.
This is done for all the screens which fields needs to be parameterized. This is one way to parameterize all the import values. Fields having mode ‘S’ (Set) under each dynpro of the command interface contain some value entered during the recording. This is the value one needs to parameterize as Import Parameter so that with
next run a new set of data will be passed to the recording. And recording becomes reusable Defining Export Parameters: The output results of the transaction are assigned to export parameters. Export parameter are necessary for chaining of transactions wherein output of one transaction becomes input for other transaction. Here export parameters can be linked between the two transactions interacting. Eg :
Insert Export parameter button
Read field value window appears. The field with the technical name appears against which the Param. Name needs to be given. Give the name of the export parameter. Click on enter. Automatically the name will be included in the Parameters list. Click on Back (F3) button from the standard toolbar
Fields having ‘G’ (Get) as mode are assigned to export parameters. Last dynpro in the dynpro list just before the MSG node in the command interface contains the output messages and other outcomes. Export parameters can be assigned for these values.
Defining Check Parameters: One can check whether the runtime value of a field is the expected value or not. The check value can be a constant or a parameter value.
Insert Check parameter button
Maintain field check dialog box appears. Give the name of the variable in the Param. Name. If it doesn’t exist, it will be created automatically as import parameter in the parameter list. Give the value against this field. Click on enter
The status of the values on the structure editor, either fixed or parameterized or not defined are symbolized as follows :
Creation Of System Data Container (SD):
In the System Data input field give the name of SD. Click on Create Object (F5) icon from the application toolbar. On the create screen, in the Attribs tab, give the Title (mandatory) for the SD. Under the System Data tab, target system NONE is already present. Append a new row by clicking Append row icon from the toolbar. If the test is to be conducted in the remore system in the Test System column, give the name of the target server. By this name the target system will be referred in eCATT. Under the RFC Destination column, select the respective RFC for the target system. The Instance Description field is automatically filled by system.
Click on Save (Ctrl+S) icon from the standard toolbar.
This way multiple target systems can be added to the system data. Creation Of Test Data Container (TD):
Test data containers are used for creation of variants. Variant values are also maintained in TD. Variants created in TD are linked in Test Configuration. TD is independent of test script. Hence once created can be used for multiple scripts. In the Test Data input field, give the name of the test data. Click on Create Object (F5) icon from the application toolbar.
On the create screen, under the Attributes -> General Data tab in the Header Data section, give Title (Mandatory) and Component (Mandatory). Under the Maintenance System, give the SystemData Container as well as Target System, which is present in the SD(above step) .
Under the Parameters tab, under the Edit - > select Import parameters, which navigates to the import parameter screen. Upon selecting the test script and giving name of the script and the version number of the script, and click on the get parameter, all the parameters defined in the script are displayed on the left hand side .
Select all the parameters and click on copy button at the bottom of the screen. Which will bring this parameter to the TD screen.
On . Click on Save (Ctrl+S) button from the standard toolbar to save the TD container. To create variant, minimum one parameter should be present in parameter list. Under the Variants tab, the column titles are Variant, Description & after that the parameters from the parameters list. ECATTDEFAULT variant will be present as default. This variant contains values from the Parameters under the Parameters tab.
To add new variants, click on Append Variant icon. Give the details of new variant with values. Add required number of variants this way. Click on Save (Ctrl+S) button from the standard toolbar.
Creation Of Test Configuration (TC): Test Configuration contains reference to one Test Script (TS), one System Data container (SD) and can contain reference to multiple Test Data container (TD). TC is used in scripts management using TestWorkbench in R/3 system. Advantage of using TC is that for any given script, without changing data at TS level, the script can be checked for different sets of data using Variants of TC. In turn these variant values are captured from TD. Hence the errorless recording time data is always maintained in TS. Give the name of TC in Test Configuration and click on Create Object (F5) icon from the application toolbar.
On the create screen, give the Title (Mandatory) & Component (Mandatory).
Under the Configuration tab, give the System Data Container, which contains the Target System. Also give the name of Test Script. Test Data and an Alias can be added to Test Data section using Append Row icon. The Alias is an alphanumeric name up to three characters. Multiple test data can be given if required.
Variants can be added from Variants tab. The TC references the import part of the data interface of the test script. Variants can be prepared either manually by clicking the icons Append Variant/Insert Variants or from the wizard using test data containers referenced in the Configuration tab. Manually Creating Variants: In the Test Configuration editor under Variants tab, click on the Append Variant icon. This will insert a new line for variant under ECATTDEFAULT.
This way multiple variants can be directly added to Variants list. Variants from Test Data Containers: Prerequisite for this option is that Test Data Containers should be maintained under Configuration tab. To create variants from the Test Data containers, click on the wizard icon . (Variant Maintenance Assistant) under the Variants tab.
The Variant Maintenance Assistant window appears. The left half of the screen displays the variants belonging to a test data container. The right half of the screen displays the variants belonging to the test configuration. Scrolling between the multiple variants of Test Data is available. Select the variant from the Test Data & click on Attach as variant button. The variant will be copied to Test Configuration side.
Click on Save (Ctrl+S) icon from the standard toolbar. And Test Configuration is now ready to execute or to link to TestWorkbench depending on the variant selected.