40
eCATT (Extended Computer Aided Test Tool ) 1. eCATT- An Introduction eCATT-Extended Computer Aided Test Tool 2. eCATT: Creating Test Scripts Understanding eCATT 3. eCATT: Creation of Test Data Container Creating Test Cases using eCATT 4. eCATT: Creating & Executing Test Configurations 5. eCATT: Creating a Test Case for a Web Dynpro Application This Weblog will discuss how to create a Test Case for a Web DynPro Application. This is one of the major features of eCATT that allows users to test business processes that cross system boundaries. 6. Procedure to create eCATT script 7. Writing a CAT script to create user

eCATT

Embed Size (px)

Citation preview

Page 1: eCATT

eCATT

(Extended Computer Aided Test Tool )

1. eCATT- An IntroductioneCATT-Extended Computer Aided Test Tool 

2. eCATT: Creating Test ScriptsUnderstanding eCATT  

3. eCATT: Creation of Test Data Container Creating Test Cases using eCATT  

4. eCATT: Creating & Executing Test Configurations

5. eCATT: Creating a Test Case for a Web Dynpro Application This Weblog will discuss how to create a Test Case for a Web DynPro Application. This is one of the major features of eCATT that allows users to test business processes that cross system boundaries.  

6. Procedure to create eCATT script

7. Writing a CAT script to create user

Page 2: eCATT

1.Introduction to eCATT.

The Extended Computer Aided Test Tool is a new automated testing tool that allows you to create automated functional test cases for the majority of applications running in the SAP GUI for Windows and SAP GUI for Java environments. Like other test tools, it works by making a recording of an application, which you can then parameterize and replay with differing sets of input values. You can test the behavior of the application by reading and testing the values returned by the application .eCATT is available from Release 6.20 of the SAP Web Application Server, and is an integral part of the mySAP Technology underlying SAP R/3 Enterprise Release 4.7.

Designed as a successor to the existing CATT, it allows a user to record and replay any application running under SAP GUI for Java or SAP GUI for Windows. Furthermore, because it is embedded within the SAP application server, it has access to other interfaces, such as function modules, BAPIs, or the SAP database (so that users can perform checks), and the ABAP runtime, which lets users write ABAP routines into test cases.

With SAP eCATT, users are also able to test business processes that cross system boundaries. Each command in a test script can have a separate destination so, within one script, a user can call a transaction in mySAP Customer Relationship Management, and also check table entries in an SAP R/3 system. Within a script, logical names are used to refer to target systems. These logical names are mapped to actual RFC destinations in a separate object called a system data container, which is, effectively, a description of the company’s system landscape. Thus by linking a different system data container with a script, a user can execute it in a completely different system landscape without having to alter the script coding at all. The only prerequisite is that all the logical system names that the script uses are defined in the relevant system data container.Because of the wide variety of applications that may need to be tested, eCATT does not have a single "one-size-fits-all” way of recording and replaying applications. Instead, there are various drivers that encompass the following kinds of scenarios:

• Table operations– interacting with the SAP database • Function modules and BAPIs • ABAP • Transactions and reports • Applications running outside the SAP GUI for Windows or Java environments

For the last of these scenarios, eCATT offers an interface that third-party tool manufacturers can implement to integrate their tools with eCATT.

You can migrate test cases from Computer Aided Test Tool (CATT) to take advantage of the better features of eCATT.

eCATT is also integrated with the Object Navigator (SE80).

FeaturesUsing eCATT we can:

• Test transactions, reports, and scenarios

Page 3: eCATT

• Call BAPIs and function modules• Test remote systems• Check authorizations (user profiles)• Test updates (database, applications, GUI)• Test the effect of changes to customizing settings• Check system messages 

Constraints

eCATT runs in a system based on SAP Web Application Server 6.20 or higher. However, you can use this system to test systems with Release 4.6C or higher.

In my forth coming weblog’s I will be going through the following topics :

1. Creating Test Scripts . 2. Creating Test Data Containers . 3. Understanding System Data Containers . 4. Executing Test Configurations . 5. Understanding Logs .

I will also demonstrate the use of eCATT with following applications: • Testing a Standard SAP Business Scenario .• Testing a Web Dynpro Application .• Migrating Test Cases from CATT to eCATT

Page 4: eCATT

2. eCATT: Creating Test ScriptsUnderstanding eCATT

Creation of Test Scripts

In my last weblog on “eCATT : An Introduction” I introduced the subject of eCATT and discussed the capabilities and features of the same . In this weblog I will be going a step further and explain the creation of Test Scripts , the first step in the creation of Test Cases using eCATT

Before creating Test Scripts using eCATT we need to have some system setting done .

1. Maintaining Table T000    a. Start transaction SM31.    b. In the Table/View field, enter T000.    c. Choose Maintain.    d. In the Change View “Clients”: Overview screen, select the relevant client and choose.    e. In the Restrictions when Starting eCATT field, select an entry that allows eCATT.

2. Enabling Scripting at the front End . ( Check whether SAP GUI Scripting component is installed. There is an option for installing this component when installing the SAP GUI.)    a. On any screen, choose Customizing of local layout.     b. Choose Options....    c. Choose the Scripting tab.    d. Select Enable Scripting.    e. Choose Apply.

3. Enabling Scripting on application server .    a. Start transaction RZ11.    b. On the Maintain Profile Parameters screen, enter sapgui/user_scripting.    c. Choose Display.    d. In the Display Profile Parameter Attributes screen, choose Change value.    e . Enter TRUE in the New value field.  Now we will start with creation of Test Scripts :The first step in the Creation of Test Case is Creation of Test Scripts .

A test script consists of three principal parts-

Its attributes The script commands The parameters

      We will be creating a Test Scripts for Sales Order Scenario .

Step1 : Goto Transaction SECATT :

Page 5: eCATT

Now the Recording for the Transaction VA01 will start .We will Record and save the Transaction .

Page 6: eCATT
Page 7: eCATT

After Recording is saved TCD Command Appears in the Command Editor.

Now Define Parameters . Only those parameters should be defined which are expected to take values at runtime.

Page 8: eCATT

On clicking the Toggle Option : The Command Editor Appears .

On clicking the “Command Interface” Option the interface appears in left bottom corner of the screen .For each screen traversed screen name and screen number appears . Within each screen all the Input values that were entered during Recording are parameterized .

Page 9: eCATT

When all the screen input fields are parameterized , save the Script .

This Creates the Test Script for the Sales Order Scenario.

In the next Weblogs I will be discussing Test Data Containers , System Data Containers and Test Configurations to complete the Test Case for the Sales Order Scenario.

Page 10: eCATT

3. eCATT: Creation of Test Data Container Creating Test Cases using eCATT  

Creation of Test Data Container:

In my last weblog we were discussing creation of Test Case for Sales Order Scenario .The first step for Creation of Test Case i.e. creation of Test script was covered in the previous weblog . In this weblog we will continue the flow and cover Creation of  “ Test Data Container” and “System data Container “ for the Test Scenario.

Transaction ‘SECATT’. : Creating Test Data Container

Page 11: eCATT

Now Create Variants for the Test Case .

The Script will be Tested with these 3 variants . These Variants define the different set of values with which the Scenario will be tested . In the above case the Sales Order Creation will be tested for different set of Sales Area Data ( different distribution channels in namely: 10 12 & 16 )

After creation of Test Data Container , In the test script the parameters are assigned to the Input values/Output Values .

Parameterizing Input Fields :

You must set the field mode to ‘S’, and enter a literal or the name of a parameter in the VALIN column. At runtime, the screen field will be filled with the value that you specified.

Page 12: eCATT

Parameterizing Output Fields :

You must set the field mode to ‘G’, and enter the name of a parameter in the VALIN column. At runtime, the parameter will be filled with the value from the screen field.

Now Creation of System data Container :

Page 13: eCATT

Transaction ‘SECATT’.

Since we are not Doing Remote Testing .Therefore Test System is “NONE”(In Case of Remote Testing RFC destination has to be created in SM59 and should be specified under “RFC Destination Tab”)

In the next weblog Creation of  “Test Configuration” and Execution of the Test Case will be covered thus completing the Test Case for Sales Order Scenario.  

Page 14: eCATT

4. eCATT: Creating & Executing Test Configurations

Creation of Test Configuration

In my previous weblogs on eCATT we were discussing “Creation of Test Case for the Sales Order Scenario” . In the last weblog I had demonstrated the creation of “Test Data Container” . The only step left for the completion of Test Case for the above said scenario is the creation of “Test Configuration “.

I will explain creation of “Test Configuration” with the help of Screen Shots .

Transaction ‘SECATT’ . : Creating Test Configuration .

Page 15: eCATT

In the Test Configuration ( zsales_config ) Test data “ZSALES_DATA”( Created in last Weblog ) is attached .

Note : The field Target System is Blank as Testing will be performed Locally .

Now we have to copy variants from Test Data Container to the Test Configuration .

Page 16: eCATT

The above screen shows the three variants namely : · ECATTDEFAULT · VAR1· VAR3

Now the execution of this Test Configuration will Test the Sales Order Process with three different set of data .

Executing Test Configuration : zsales _config .

Page 17: eCATT

Now , The Log Generated after ZSALES_CONFIG was executed .

The Log reveals that variant ECATTDEFAULT AND VAR1 executed successfully ( i.e sales order creation was possible with these set of Data ) But with Variant VAR3 Error : Order type OR not defined in Sales Area<1000 16 00 occurs . From the above Test Scenario we were able to infer that Standard Sales Order type OR cannot be created in Distribution channel 16 .

Thus we have successfully created a Test Case for the Sales Order Scenario .

In my next weblog on eCATT , I will discuss Creation of Test Case for “WebDynpro” applications .

Page 18: eCATT

5. eCATT: Creating a Test Case for a Web Dynpro Application

This Weblog will discuss how to create a Test Case for a Web DynPro Application. This is one of the major features of eCATT that allows users to test business processes that cross system boundaries.

In my previous Welogs on eCATT , I discussed topics starting from "Introduction to eCATT" to "Executing a Test Case using eCATT ". This Weblog will go a step further and discuss how to create a Test Case for a Web DynPro Application. This is one of the major features of eCATT that allows users to test business processes that cross system boundaries.

The scenario for Test is as follows :

Scenario

1. The goal is to create a Test Case for a Web Dynpro Application that is on java Stack . 2. The application is for Purchase Order Creation.

3. The application will be tested for different set of data .

4. The url is : http://<server>:<port>/webdynpro/dispatcher/local/PO/CreatePO

Procedure:

The first step towards creating a Test Case for a Web Dynpro Application is to create a RFC destination in SAP .

Page 19: eCATT

Tcode : SM59 RFC Destination : WEBDYNPRO2 , Type : GTarget Host : <server> Service : <port>

Now , create a System data Container assigning HTTP RFC destination created above .

Tcode : SECATT

Page 20: eCATT

After creation of Test Data Container , Create Test Script . ( the creation of the same has been discussed at length in my previous weblogs )

In pattern option under UI control Group select WEBDYNPRO command . Entering System data Container and Target System .

The Application in our case is “/webdynpro/dispatcher/local/PO/CreatePO”

Recording starts . The application starts in the browser .

Page 21: eCATT

Entering appropriate Header Info in the fields .

Adding item details .

Page 22: eCATT

Creating Purchase Order .

The PO is created in SAP and the PO number is reflected in top right corner .

Now , click “Stop Recording” Option .

Page 23: eCATT

Below we can see a WEBDYNPRO command is created for each page of application.

Now Parameterize the Input values

Page 24: eCATT

Creating Test Data Container .

2 Variants for are created . The Company code data is different in both cases .

For Test Variant 1 : Company Code is 1000.For Test Variant 2 : Company Code is 3000.

Page 25: eCATT

Now Creating Test Configuration and attaching Test Data Container .

Executing Test Configuration .

Page 26: eCATT

Examining Log we see that :

PO can be created with var1 ( Company Code :1000 )

PO cannot be created with var2 ( Company Code :3000 )

Thus we were able to successfully Create a Test Case for a "Web Dynpro Application" deployed on Java Stack using eCATT.

Page 27: eCATT

6. Procedure to create eCATT script

Make sure the client setting is changed to allow ecatt. Follow the instruction below

Execute transaction SCC4SAP R/3 Menu : Tools -> Administration -> Administration -> Client Administration -> Client Maintenance

Then carry out the following steps:1. Choose Display 2. Confirm the warning message Caution: The table is cross client. 3. Select your SAP R/3 client and choose Details. 4. In the Change View Clients: Details screen, activate the following settings: • eCATT and CATT allowed.5. Save.6. Go back to the SAP Easy Access menu.

Now lets start with creating ecatt

On the eCATT (tcode -SECATT) initial screen, select the Test Script radio button and enter a name for your new test script in the field beside it. Here, we will name it

Page 28: eCATT

ZCREATE_USER. Leave the remaining fields empty.

Choose the Create Object icon, as shown above, to open the editor for the test script.On the Attributes tab, enter the following information:

Field Entry

Title Create user - SU01

Component BC-SEC

System Data Container TUTORIAL (optional)

Leave the Target System field empty. We will not use this field in this tutorial.

Page 29: eCATT

Switch to editor tab and click on pattern. On the insert Statement window fill in as below

Field Entry

Group All Commands

Command TCD (Record)

Transaction SU01

This will start recording and take you to the user create screen and continue the user creation. In our example a userid (ZTEST_97) is created with Z:TESTROLE. Save the user and hit the back button. This will end the recording and you will we asked to save the recording. Click Yes.

Page 30: eCATT

Save the Object as local object.

Go back and switch to change mode

Click on the button shown below

Page 31: eCATT

Select SU01_1 and click on the button shown below

Highlight Dynpro and click on the button shown below

This will switch to simualation mode and we have to parameterize. We paramerterized. User id , password and role. Look at the video

Hit the back button and save the script. Create Test Configuation

Select Test configuation from the initial screen as shown below

Page 32: eCATT

Fill the Attributes as below

Fill in the Configuration tab as below

Fill in the variat tab as below

save as local object.

Page 33: eCATT

Download the variant as show below.

Open it in a excel and add data. Save it as txt file.

Run SECATT and select Test configuration and hit execute

Select variant tab and select the row as show below

Page 34: eCATT

and choose the file you edit with excel as shown below and hit execute. Check the result.

If you have any issue running this ecatt let us know.

7. Writing a CAT script to create user

1

Recording a test case

1.1

To record a test case, call Transaction SCAT and enter test case Zuser_creat. Do not choose Enter. Choose Test Case → Record Transaction. Enter Transaction SU01, and choose Record/Enter. The system runs Transaction SU01. Enter the user name TESTZ and choose Create. Enter the user’s title first name ZEBRA and the last name TEST.

Page 35: eCATT

Select the Logon data tab, enter init as the initial password, and repeat the password, profile select sap_all then choose Save. Go back a screen and In the dialog box displayed, select End recording. A message is displayed stating that the recording has ended. Enter the test case title User maintenance. In the field Component, enter BC-SEC-USR. Save the test case. In the field package class, enter $TMP. Choose Save to save the attributes. To save the test case functions, go back.

2

Entering parameters for a test case

2.1 To define parameters for a test case, call Transaction SCAT. Enter the test case name Zuser_creat. Select Functions and choose Change. Double-click on TCD. Then double-click on program SAPLSUU5 screen 0050. (first appearance of this program) The first screen of Transaction SU01 is displayed. (If you backed out, enter the procedure name again and double-click on TCD.) Double-click on the user name field. In the field Param. name, enter an "&", and choose Copy/Enter. Choose Next screen and double-click the last name. In the field Param. name, enter an "&" and choose Copy/Enter. Go back until the Save folder appears, and choose Save.

3

Creating and using an external variant for the test case

3.1 To export the default parameters into a frontend file, in the test case, select Goto → Variants → Export Default. Note: The default file name is <the name of your test case>.txt. Do not change the default values.

3.2 Open the file, with excel and edit and add another couple of user, and save the text file

3.3

To execute the test case using the external variant from file, from the initial CATT screen, enter the test case name and choose Execute. In the field Variants, select External from file and choose Choose. Select the file created above, and choose Open. Under Processing mode, select Errors, and choose Execute. Note: When you use this method, the file must be imported each time the test case is executed (file remains only on PC).