47
eCATT (extended Computer Aided Test Tool) What is eCATT? eCATT is an SAP Testing Tool used to automate & test business scenarios in R/3. Each test generates a detailed log that documents the test process and results. If the testing is smooth without any errors, this means that the business scenarios mapped in R/3 are correct. If the test results in error then the problem can be analyzed using the error log that is generated. eCATT enables automatic testing in SAP GUI for Windows and SAP GUI for Java. Features of eCATT: Following functions can be performed using eCATT: Test transactions, reports and scenarios. Call BAPIs and function modules. Test remote systems. Check authorizations (user profiles). Test updates (database, applications, GUI). Set up customizing tables. Test the effect of changes to customizing settings. Perform load testing. Check system messages. Integrated with Test Workbench, so allows proper management of scripts using SCAT transaction. Supports CATT migration to eCATT. All eCATT Objects are Repository Objects. Therefore one can take advantage of Standard SAP Transport Tools. eCATT Objects can easily download & upload in XML with XSD format. There can be several versions of Test Scripts, which allows different implementations with different releases. The separation of Test Scripts, Test Data & System Data allows for a considerable degree of reuse. Why eCATT?

eCATT Sap Technical

Embed Size (px)

Citation preview

Page 1: eCATT Sap Technical

eCATT (extended Computer Aided Test Tool)

What is eCATT?

eCATT is an SAP Testing Tool used to automate & test business scenarios in R/3. Each test generates a detailed log that documents the test process and results. If the testing is smooth without any errors, this means that the business scenarios mapped in R/3 are correct. If the test results in error then the problem can be analyzed using the error log that is generated. 

eCATT enables automatic testing in SAP GUI for Windows and SAP GUI for Java.

 Features of eCATT:

Following functions can be performed using eCATT:

Test transactions, reports and scenarios. Call BAPIs and function modules. Test remote systems. Check authorizations (user profiles). Test updates (database, applications, GUI). Set up customizing tables. Test the effect of changes to customizing settings. Perform load testing. Check system messages. Integrated with Test Workbench, so allows proper management of scripts using

SCAT transaction. Supports CATT migration to eCATT. All eCATT Objects are Repository Objects. Therefore one can take advantage of

Standard SAP Transport Tools. eCATT Objects can easily download & upload in XML with XSD format. There can be several versions of Test Scripts, which allows different implementations

with different releases. The separation of Test Scripts, Test Data & System Data allows for a considerable

degree of reuse.

Why eCATT?

 CATT is no longer supported by SAP for the creation of new developments. Hence all the test scripts developed in CATT are now need to migrate/Update to eCATT. Comparative to manual testing, the following are advantages of using eCATT:

Due to automation, testing time is reduced to a large extent. Due to automation, less manpower is required for testing. This helps financially. Due to automation, manual errors are reduced to large extent. Hence results in error

free testing. This helps, as no further problems will occur while the usage of R/3 system by end users and hence increases the efficiency.

Page 2: eCATT Sap Technical

Proved to be extremely useful in implementation projects.

In regression testing, automated test scripts are an ideal method of quickly detecting errors. Automatic test logs make it easy to reproduce test results, enabling fast analysis and planning of further activities, leading to cost savings for the customer.

eCATT (extended Computer Aided Test Tool)

Differences between CATT and eCATT?

Till date, CATT could only be used with the R/3 system. eCATT (which is available with SAP Web Application Server 6.20) covers the automatic testing in SAPGUI for Windows and SAP GUI for Java. For other GUIs and Applications, eCATT provides an interface for external tools. This allows companies to perform automated tests from an SAP system in a complete IT solution landscape across system boundaries. These new options enable complete automation of solution landscapes under standard Windows and Web-based user interfaces- resulting in low-cost operation of an IT Solution. 

eCATT (extended Computer Aided Test Tool)

eCATT requisites

Web Application Server (WAS) 6.20 or more. SAPGUI 6.20 or more. R/3 4.6C or more. (Target system must have sufficient support package level (Details

available in SAP Note 519858) or SAP R/3 Enterprise Release 4.7).

 Before creating Test Scripts using eCATT, some system settings need to be done: 

Maintain table T000.

1.      Go to transaction SM31

Page 3: eCATT Sap Technical

2.      Enter T000 and chose MAINTAIN.

3.      In the Change View “Clients”: Overview screen, select the relevant client and choose “Details”

Page 4: eCATT Sap Technical

4.      In the “CATT and eCATT Restrictions” field, select “CATT and eCATT allowed”.

5.      Click on SAVE. 

Enabling scripting at the Front-end

1.      On any SAP GUI screen, choose “Customizing of Local Layout”.

2.      Choose Options

Page 5: eCATT Sap Technical

3.      Choose “Scripting Tab”

4.      Select “Enable Scripting”

5.      Click Apply and then OK. 

Enabling Scripting on the Application Server

1.      Go to transaction RZ11.

2.      On the Maintain Profile Parameters screen, enter sapgui/user_scripting.

Page 6: eCATT Sap Technical

3.      Choose Display.

4.      If the Current Value is not set to TRUE, then click on Change Value:

Page 7: eCATT Sap Technical

5.      Enter TRUE in the “New Value”.

6.      Click on SAVE.

eCATT (extended Computer Aided Test Tool)

eCATT Vs Mercury QTP

By Sapna

SAP eCATT is a automation tool meant for functional testing in SAP. It comes with WAS. Latest version is WAS 6.40. It is made in ABAP.

QTP is Mercury's tool, which is a third party tool for automation testing. The language used here is VB Script.

Both the tools are good. But the only drawback with eCATT as of now is that it can execute web based SAP transactions except WebDynpro. So if the testing of SRM, CRM etc is involved, one is forced to use QTP.

QTP takes the wrapping of eCATT and executes in SAP.

If only SAPGUI based transactions are involved in testing than eCATT is the best tool to be used. And if web based transactions are also involved, forced to go for QTP.

Creating a simple eCATT Test Script for MM02 transaction

By Raghava Vakada, Mouri Tech Solutions

Page 8: eCATT Sap Technical

A Simple scenario on eCATT Test Script to the Standard Transaction.

In this scenario, I would like to explain about create Test Script for “MM02”.

Procedure

Start transaction SECATT.

On the eCATT initial screen, select the System Data radio button and enter a name for your new system data container in the field beside it. For this tutorial, we will refer to it as ZTEST_SDC. 

On the Attributes tab, enter a title for the system data container – for example, System Landscape for MM02.

In the System Data tab, you would notice a default target system called NONE.

Save your system data container.

Page 9: eCATT Sap Technical

Creating Your Test Script

In this section, you will create an empty test script and assign to it the system data container that you created earlier. You will then execute the test script.

On the Attributes tab, enter the following information:

Title : Test Script for MM02

Component : BC-TWB-TST-ECA

System Data Container : ZTEST_SDC

Leave the Target System field empty.

Page 10: eCATT Sap Technical

Save your test script.

Choose Execute Button and Execute the Test Script.

The Start Options are displayed.

Accept the defaults but make sure that Log Display has been selected.

Select the checkbox Highlight All Called GUI Elements. This option is cosmetic but will help you see which elements are being selected during replay. Leave the other default options as they are.

Page 11: eCATT Sap Technical

Execute the test script. The log will then be displayed and should look something like the following:

Get back to the Test Script Editor.

Recording the Transaction

Starting the Recorder

n the test script editor, choose the Pattern function to display the Insert Statement dialog.

In the dialog, change the group to UI Control, choose SAPGUI (Record) for the command.

Page 12: eCATT Sap Technical

Specify the transaction MM02 that you want to record. Additionally, select the check box that will automatically generate a new SAPGUI command after every screen change ( You must first deselect manual generation).

Choose Start Recording or Enter

Click on “Yes”.

Page 13: eCATT Sap Technical

A new session is automatically created. You can, and should, switch back and forward between the two sessions using the taskbar as shown below.

Enter the Material

Select the Basic Data1

Basic Data1 Screen as shown.

Change the “Gross Weight”.

Page 14: eCATT Sap Technical

Save and Close the screen

Ending the Recording 

Select the Close Recorded GUIs check box and then choose Stop Recording.

The recorded session closes and you now see the SAPGUI commands in the command editor of the test script editor.

Page 15: eCATT Sap Technical

Above the command editor is the parameter list. You can use the button at the top left of this section to toggle between the display of normal parameters and the command interfaces.

Choose Save.

Executing Your Test Script 

In the test script editor, choose “Execute” button.

Page 16: eCATT Sap Technical

Choose “Execute” Button in the Start Options screen. Check the log.

Starting eCATT with TCD Recording Method

By Venkat

Step1: Use the Transaction code SECATT to test the data using eCATT (Extended Computer Aided Tool). Provide Test Script name in the initial screen of eCATT. Here, in the scenario I have given Test Script as ‘ZDEMOTEST’ and version as ‘1’. 

Page 17: eCATT Sap Technical

 

Click ‘CREATE’ button. 

Step2: In the next screen, we have TWO tabs.

1. Editor Tab where we can write our own ABAP code and use the eCATT special commands. 2. Attribute Tab where we can provide Title, Component to which we are testing data.

 

Step3: Click the Pattern button on Application tool bar to select recording method. Select TCD (Recording) method. 

Step4: Select the pattern button. A pop-up box appears where you have to select GROUP as ‘UI Control’. And COMMAND as ‘TCD (Recording)’ as shown. Provide the transaction as MM01 and press enter. 

Then the system automatically proposes Interface name and don’t change this Interface name. In this scenario system proposes MM01_1. 

Now, click ‘OK’ button to start recording. 

Page 18: eCATT Sap Technical

 

Step5: After the recording is done, you will get message the ‘Recording Ended’ and press ‘YES’. 

 

And the following screen appears. 

 

Save and check syntax check. 

Step6: First of all execute the script without parameterization to confirm errorless recording.

At the run time, a start options window appears. Select the following options as shown. 

Page 19: eCATT Sap Technical

 

And in UI Control Tab,

Page 20: eCATT Sap Technical

 

Click on Execute button. 

Step7: After execution of the transaction, if the recording is free from errors, then the success log would be displayed. Suppose if there are any errors in recording of the transaction then the detailed error log would appear. 

If the transaction has executed successfully, you would get the following messages.

Page 21: eCATT Sap Technical

Starting eCATT with SAPGUI Recording Method

By Venkat

Step1: Use the Transaction code SECATT to test the data using eCATT (Extended Computer Aided Tool). Provide Test Script name in the initial screen of eCATT. Here, in the scenario I have given Test Script as ‘ZDEMO_TEST’ and version as ‘1’. 

 

Page 22: eCATT Sap Technical

Click the Create button. 

Step2: In the next screen, we have TWO tabs.

1. Editor Tab where we can write our own ABAP code and use the eCATT special commands. 2. Attribute Tab where we can provide Title, Component to which we are testing data.

Here, I selected the component ‘MM-PUR-SQ- SLI’ (Source List).

 

Step3: To do the recording, click the Pattern button in the application tool bar.

Here, we can do recording in TWO ways.

1. SAP GUI(Recording) 2. TCD(Recording)

Now, we use SAP GUI (Recording). 

Step4: Select the pattern button. A pop-up box appears where you have to select GROUP as ‘UI Control’.

Page 23: eCATT Sap Technical

And COMMAND as ‘SAP GUI (Recording)’. 

 

Click ‘OK’ button.

Step5: Click ‘YES’. 

 

The following screen will appear. 

Page 24: eCATT Sap Technical

 

Select all check boxes of Automatic Generation. Provide the T-code to which we have to be started recording. 

Now select ‘Start Recording’ button to start recording of the corresponding transaction code we have mentioned. 

You will get pop-up box and click ‘YES’ to continue recording. 

Step6: After recording, a SAP GUI command and its associated command interface will be inserted in the test script editor. 

 

Save and check syntax check. 

Step7: First of all execute the script without parameterization to confirm errorless recording.

At the run time, a start options window appears. Select the following options as shown. 

Page 25: eCATT Sap Technical

 And in UI Control Tab, 

Page 26: eCATT Sap Technical

 Click on Execute button. 

Step8: After execution of the transaction, if there is no errors are found while recording, then you will get success log. Suppose there is error in recording of the transaction then the detailed error log will appear.

Creating a simple eCATT test script using ABAP Objects

By Raghava Vakada, Mouri Tech Solutions 

“I would like to explain about eCATT scenario on ABAP Objects. In this scenario I am explaining from Test Script Creation about ABAP Objects and the Command is “Createobj”. For this scenario we need to know about global classes or at least you should know about standard classes and I am not explaining about System data container. I explained in my previous scenario”.

Creating Test Script. 

Page 27: eCATT Sap Technical

Go to Transaction “SECATT”.

Enter the test script named “ZTEST_OOABAP”. 

Enter the Title, Component and System data Container. 

 

Procedure

1.        In the parameter list, create a parameter with the reference type that you want to instantiate. 2.        In the command editor, set the focus where the command is to be entered. 3.        Choose Pattern. 4.        In the Group field, choose ABAP Objects. 5.        In the Command field, choose CREATEOBJ. 6.        If you want to create a parameter, enter the name of the wanted class in the Class field. 7.        In the Object Instance Parameter field, enter the parameter name. 8.        Choose Enter.

Page 28: eCATT Sap Technical

9.        In the Interface field, accept or change the suggested name. 10.        Choose Enter.

The above process as shown in below screen 

Save and Test the Object.

In the “Start Options” screen.

Press the “Execute” Button.  

Page 29: eCATT Sap Technical

 

The result is as shown below.

Parameterization in eCATT

By Venkat

In eCATT script we can pass 3 types of parameters.

Import Export Local variables 

Import Parameters: Import Parameters are input values to the test script. These variables are the local to the script i.e. Import Parameters can access only in eCATT script editor but not in ABAP…ENDABAP block. These are version independent. 

Page 30: eCATT Sap Technical

Export Parameters: Out put result values after executing the script are caught in Export Parameters. These variables are the local to the script i.e. Export Parameters can access only in eCATT script editor but not in ABAP…ENDABAP block. These are version independent. 

Local Variables: Local Variables are used in both eCATT script editor and ABAP…ENDABAP block. These are version dependent i.e. local variables defined in one version is not automatically defined in other version. 

After the recording has been done for the particular transaction without parameterization, we need to check whether the recording is error free or not. Once it is confirmed error free then we go for parameterization of required fields. Usually we go for parameterization for reusability of eCATT script. Different set of data can be passed via parameters and recorded script can be used again and again. 

Parameterization in TCD mode: 

Fields having mode ‘S’ (Set) under each dynpro of command interface contains some values entered during the recording. These are the values need to be parameterized as Import, Export or Local as shown below. 

Replace the value ‘P’ in VALIN with I_MBRSH parameter. 

 

And now double click on the parameter I_MBRSH then the following screen will appears. 

 

Select Local and click ‘YES’. 

The output result of transaction is assigned to Export parameters. These are very useful in chaining of transactions where the output of transaction is input to another transaction. 

Page 31: eCATT Sap Technical

In this mode, last dynpro of the dynpro list just before the MSG node in the command interface contains the output messages as shown below.  

 

Here we have to change the mode ‘O’ (Field output) to mode ‘G’ (Get) and assign Export parameter in VALIN as shown below. 

 

Parameterization in SAPGUI mode: 

Now double click on each step of command interface of SAPGUI command from the test script editor. In this case, first double click on “ME01_200_STEP_2”. Then you will get following screen. 

Page 32: eCATT Sap Technical

 

Now replace value of material number T-BW06-02 with parameter. Here, T-BW06-02 is replaced with I_MATNR. 

 

Now double click on I_MATNR then you will get pop-up box as shown. 

 

Click ‘YES’. The entry appears in Parameter list and provides parameter reference. 

 

The output result of the transaction in this mode can be captured using MESSAGE….ENDMESSAGE node. 

Page 33: eCATT Sap Technical

Click the Pattern button from the application tool bar and select MESSAGE…ENDMESSAGE option as shown. 

And click ‘OK’.

Now the following screen appears. 

Now place the command interface between MESSAGE….ENDMESSAGE command to capture the export parameter. 

Here, the material number is captured in parameter1 (MSGV1). Now we can assign this value to export parameter as shown below. 

Page 34: eCATT Sap Technical

Testing "Creation of a Sales Order"  o Create "Test script" to create a Sales Order (More details)o Create "Test Data" container (More details)o Create "Test Configuration" (More details)

Create Test script to create a Sales Order

By Rama Jyothi P

Purpose: This document details on how to create a Test Script to Create a Sales Order. We can call this script as Unit Script as it deals with a single transaction. If the script is a combination of multiple unit scripts then we can call it as an Integration Script.  

Transaction: SECATT 

Here are the steps to follow. 

Step 1: Go to transaction SECATT 

Choose Radio Button Test Script and give some name like ZSD_CREATE_SALESORDER_TS (In general we will follow the naming convention Z<module>_desc. of script_TS (TS for test script)). 

 

Page 35: eCATT Sap Technical

Click the create button as shown in above screen shot. 

Step 2: In the next screen give some description for the Script. Also specify a Component. We can choose the area related to the transaction we are using from F4 help. In this case I have chosen Sales Orders component. 

We can specify a System Data container (not mandatory). We can choose one of the options from F4 help. 

 

Now save the script. Save as Local Object. 

Step 3: Now select the tab Editor. 

Write proper comments and place the cursor in the next line and click the button as shown in the below screen shot.  

 

Page 36: eCATT Sap Technical

Or we can choose Pattern and use SAPGUI REC (SAPGUI Recording).

The below pop-up will come. Un-check Manual Generation and check other check boxes.

Click Start Recording. 

 

Step 4:  

Click OK in the below pop-up. 

The below message will come in the status bar. 

 

Now generate a new Session. 

Page 37: eCATT Sap Technical

 

Step 5: Wait for a while. The below pop-up will come. 

 

Click Yes and wait for the below pop-up to come. 

Page 38: eCATT Sap Technical

 

Leave the pop-up as it is and go to the new session created. 

Step 6: Enter the T-Code and press Enter. 

Step 7: Enter the below details and press Enter. 

Page 39: eCATT Sap Technical

 

Step 8: Enter the below header details (before you are recording try to create one Order manually and note down all the mandatory and other useful fields and note the values. Then create the recording using SECATT. This will save us lot of time. If we encounter any errors while recording the eCATT, we have to re-record the entire thing.  

 

Enter data and press Enter. 

Step 9: Now we need to fill item details. At anytime try to use only one item as it will simplify parameters list and is less prone to errors. 

 

Enter data and press Enter.

Page 40: eCATT Sap Technical

Step 10: Press SAVE button. 

 

The below message will come on status bar.

 

So with this we are done with our recording. Now come out of the screens by using Cancel button.

 

Now press End Recording in the below screen. 

Page 41: eCATT Sap Technical

 

Step 11: Now we can the recorded screens list in SECATT as shown below. 

Page 42: eCATT Sap Technical

The below button will toggle us between parameter interface and command interface. Click the button to see both interfaces. 

 

Step 12: Double click on the screen as shown below.

Page 43: eCATT Sap Technical

Now by expanding the links in the screen we can be able to see the data parameters we have entered while recording. 

 

Now we will replace the values using parameters as shown below. 

Expand the node and double click the element highlighted in the below screen.

 

The below screen will come.

Replace the value ‘ZCR’ with I_AUART parameter name. 

Page 44: eCATT Sap Technical

 

Change the value to parameter for all the fields in all screens. If we want the value to hard coded as it is as in recording then leave the value. 

Step 13: Now create parameters. 

 

Press Enter. That will create Import Parameter I_AUART. Create all parameters like this. 

And save the script. 

 

Check the script to see if there are any errors.

 

Page 45: eCATT Sap Technical

Save the script and come out of the script. 

With this we are done with the Creation of the Test Script. Now in order to test the script we have to create Test Data container as well as Test Configuration. 

Note: While recording the script make sure that all the fields you want to record, you should place the cursor in the field and enter data or change the default data (re-enter the same default data). Then only it will record. Don’t repeat entering data. It will record the data twice. First prepare test data and then record it carefully to avoid redundancy.