59
ULM150 Automated Functional Testing Using eCATT in SAP Solution Manager

ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

Embed Size (px)

Citation preview

Page 1: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

ULM150

Automated Functional Testing Using eCATT in SAP Solution Manager

Page 2: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 2

Contributing Speakers

Jon MaidstoneProduct Manager, NetWeaver Test Tools, SAP AG

Martin Plummer Product Specialist, NetWeaver Test Tools, SAP AG

Page 3: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 3

Learning Objectives

As a result of this workshop, you will be able to:Assess the extent to which automated testing can help youUse the SAP Solution Manager as the basis for a test projectUse eCATT to create automated test casesUse the Test Workbench to manage a test project

Page 4: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

Creating Automated Tests

Running the Test Project

Meeting the Players

Defining the Solution Manager Project

Page 5: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 5

Meeting the Players: SolMan, eCATT, Test Organizer

SAP Solution Manager

The one-stop instance for managing your implementations and upgrades and for monitoring your running systems.The implementation tools allow you to define the scope of your project and to assign test cases to the various steps

Extended Computer-Aided Test Tool (eCATT)

SAP‘s tool for automated functional testing. With eCATT, you can record user interaction with the SAP GUI and edit the recordings to form modular, reusable test cases.eCATT ships at no additional charge, and is part of the Solution Manager shipment

Test Organizer

The Test Organizer allows you to create and manage test projects. Individual testers can be assigned worklists of tests (either manual or automatic). Coordinators can monitor the progress of the project. Like eCATT, the Test Organizer is part of the Solution Manager shipment

Page 6: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 6

SAP Solution Manager 4.0SAP Solution Manager 4.0

The Relationship Between The Tools

SystemLandscape

SAP NetWeaver 2004s

eCATTTest

Organizer

Project

Scope of implementation/upgrade

AssigneCATTtests

Extracttests to

form project

Page 7: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 7

Relationship To Your Other Systems

SAPSolutionManager

4.0

(inc. eCATTTest

Organizer)

DEV QAS PRD

DEV QAS PRD

DEV QAS PRD

Solution A

Solution B

Solution C

Page 8: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 8

Today‘s System Landscape

Solution Manager

System M07

Host iwdf2052

Syst. No. 14

Client 800

User ULM150-##

Password init123

CRM

System M06

Host iwdf2062

Syst. No. 20

Client 800

User ULM150-##

Password init123

Page 9: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

Creating Automated Tests

Running the Test Project

Meeting the Players

Defining the Solution Manager Project

Page 10: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 10

Solution Manager Project

Project

Administrativeinformation about

the project

Business Blueprint

Business Scenarios to be

implemented

Configuration

Transactions, Test cases, training …

Test cases areassigned to aconfiguration

Page 11: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 11

Exercise 1

Page 12: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

Creating Automated Tests

Running the Test Project

Meeting the Players

Defining the Solution Manager Project

Page 13: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 13

Extended Computer-Aided Test Tool (eCATT)

The Extended Computer-Aided Test Tool (eCATT) allows you to record automated tests for applications running in the followingenvironments

SAP GUI for WindowsWeb DynproWeb Services

You can create modular, re-usable scripts that you subsequentlychain together to represent larger business processes

Page 14: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 14

Structure of an eCATT Script

Recordan

Application

Field Checks

Mes

sage

Che

cks

Customizing Checks

Database C

hecks

Parameters

Define whatgoes in

Parameters

Define whatcomes out

Page 15: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 15

Knowing What You Want to Test

Step 1: Create Quotation

Input: Sold-to partyProductQuantity

Output: Quotation number

ActionCreate quotationin CRM

Step 2: Create Order

Input: Quotationnumber

Output: Order number

ActionConvert existingquotation intoorder in CRM

Page 16: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 16

Recording the Quotation Processing

We are going to make a recording of the CRM transaction thatcreates a quotation

(Later on, you will also record the transaction that converts a quotation into an actual order)

Some of the details will be left out – we will discuss them later on

At the end of this section, you will have a running script thatAccepts input data (sold-to party, material, quantity)Creates a quotationOutputs the quotation number for further use later on

Page 17: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 17

Recording Transactions Using SAP GUI Scripting

The eCATT command SAPGUI allows you to capture and replayapplications running in the SAP GUI for Windows environment

As well as recording an application, it allows you toAssign variables to input fieldsRetrieve values from output fieldsCheck the values of output fields

In this demonstration and exercise, we are going to1. Record the application using the SAPGUI command2. Use the GETGUI command to retrieve an output value from the screen

Page 18: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 18

Starting eCATT

To start eCATT, use transactioncode SECATT

The initial screen lookslike this:

Page 19: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 19

Creating a Script

Select the Test Script radio button

Enter the name of a Script (max. 30 characters, Z or Y namespace) and choose Create

Page 20: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 20

Script Attributes

eCATT scripts have various attributes that must be filled out:

Title, package, person responsible, application component

Description of thesystem landscapein which to work

Optional keywords

Page 21: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 21

Starting the Recording – 1

To start a recording, switch to the Editor tab and choose the Patternfunction:

Commands are grouped –Use the UI Control groupfor SAP GUI recordings

The completed dialoglooks like this:

Page 22: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 22

Starting the Recording – 2

Specify the transaction you wantto record and how often you

want a new SAP GUI command

Confirm that you want to record. Now you‘re ready to go…

Page 23: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 23

Reading Field Values During Recording – 1

Click on Insert GETGUI Command

Point and click at the fieldyou want to read

Page 24: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 24

Reading Field Values During Recording – 2

Select the relevant fieldproperties (usually Text)and choose Insert and Exit.This returns you to your recording.

Page 25: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 25

Ending a Recording

To complete the recording, switch to the Recording Running dialogand choose Stop Recording

Page 26: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 26

Exercise 2

Page 27: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 27

Function of the System Data Container

A system data container allows your script (created in the Solution Manager system) to access the systems in which the applicationsare running

In a script, you use a logical name to refer to a system

A system data container maps logical names to real RFC destinations

Different logical systems can refer to Different physical systems (CRM, ERP…)Different users on one system (employee, manager, … )

Page 28: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 28

Editing The Generated Script – Command Interfaces

Almost every generated command has a command interface

eCATT and the application under test use the command interface to communicate

You can edit a command interface by double-clicking it in the scripteditor

Double-click Command interfacecontaining the actionsyou performed

Page 29: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 29

Finding an Input Field – 1

Command interfaces are complex – but the global search functionhelps you to find the fields you are looking for…

Enter a search string –Such as the customer numberyou entered during recording

Double-click the hit-list entry to navigate directly to the field

Page 30: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 30

Finding an Input Field – 2

Double-click

eCATT opens correctpart of command interface

Replace thisvalue with a

variable

Page 31: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 31

Parameterizing an Input Field

Enter parameter name

eCATT creates theparameter automatically

Page 32: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 32

Parameterizing an Output Field

Double-click

Enter parametername

E_ORDER_NUMBER

Create the parameter as an exporting parameter

Page 33: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 33

Messages in Test Cases

Messages from the application can be sent In the status bar of the screen In the application log

These messages can be an indication to you that a particular test has succeeded or failed

They can also contain important data – for example, a customer or order number

Additionally, eCATT can send messages during script replay

Page 34: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 34

MESSAGE … ENDMESSAGE in a Script

MESSAGE ( MSG_1 ).

SAPGUI ( SAPGUI_1). SAPGUI ( SAPGUI_2).

ENDMESSAGE ( E_MSG_1 ).

Command Block

Define expected messagebehavior for the command block

Retrieve messages sentby applications under test during the command block

Page 35: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 35

Inserting the MESSAGE – ENDMESSAGE Commands

Using the Pattern function. . .

Move the ENDMESSAGE statement to the end of the statement block

Page 36: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 36

Defining a Message Rule

A message rule consists of two elements: To which message(s) does it apply?Does the script pass or fail when the message occurs?

Message rules are defined in the command interface of the messagecommand:

RequireMessage 006 frommessage class CRM_USERFACE

The script will only succeed if this message occurs during replay

Page 37: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 37

Exercise 3

Page 38: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 38

The Situation So Far

You have created the following script:

Run transaction CRMD_ORDER in CRM SystemCreate quotation with given import data

Return quotation number for further processing

Sold

-toPa

rty

Prod

uctC

ode

Qua

ntity

Quo

tatio

nN

o.

Importing

Parameters

ScriptC

omm

andsExportingParam

eters

Page 39: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 39

Quotation No.

The Next Stage

You need to incorporate your script into a wider business process:

CreateQuotation

Sold-to Party

Quotation No.Product Code

Quantity

CreateOrder Order No.

Page 40: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 40

The REF Command in eCATT

The REF command allows you to call one script from another

Each REF command has a command interface that allows you to pass data to the script that you are calling and receive data from it

Scripts called using REF can themselves call further scripts

Importing andExportingparameters

Enter values here, or usedefault values stored in called script

Page 41: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 41

Parameterizing the REF Command

The REF command is parameterizied similarly to the SAPGUI and GETGUI commands:

It does not matter that parameters in the source and target scriptshave the same name

Page 42: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 42

Copying Parameter Definitions From Another Script

To pass data to a script, you generally need an appropriate set of parameters in the calling script

If these already exist in the called script, you can copy theirdefinitions by choosing Edit → Parameter/Command Interfaces →Import:

Select

Transfer

Page 43: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 43

Exercise 4

Page 44: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 44

Archive

Test Configuration

Making the Test Executable

TestScript

SystemData

Container

Test Data: Variants

Log

Page 45: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 45

Creating the Configuration

The easiest way to create a configuration is directly from a script.

If you do this, eCATT does much of the work for you ☺

Page 46: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 46

Variants

Without doing anything to you test configuration, you can run thetest with

The default values of the importing parametersNo data at all

However, you can also add any amount of data to the configurationby

Entering it manually in the grid in the configuration editorUploading the contents of a tab-delimited text file

Variants are useful forTesting good/bad/questionable combinations of dataCreating data that you will use later onGoing beyond a boundary (keep creating orders – what happens whenthe stock runs out?)

Page 47: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 47

Exercise 5

Page 48: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

Creating Automated Tests

Running the Test Project

Meeting the Players

Defining the Solution Manager Project

Page 49: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 49

Back to the Solution Manager…

Armed with your eCATT test configurations, you can go back to theSolution Manager project and assign them to the configuration:

Page 50: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 50

Solution Manager and Test Organizer

Solution Manager

Contains project

Test Organizer

Test Plan

Contains all test casesfrom Solution Manager

project

Test PackageSubset of

tests

Test PackageSubset of

tests

Worklist

Each test package isassigned to a userReport

ErrorMessages

Proc

ess

Help Desk

Page 51: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 51

Creating the Test Project

Use this option to extract all test cases froma given Solution Manager project

Enter atitle

Page 52: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 52

Selecting Test Cases

1. Select therequired

test cases

2. Generate thetest plan

Page 53: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 53

Dividing Up the Test Plan Into Test Packages

Each test package contains one or more test cases from within thetest plan

A test package is assigned to a particular user, who will see it in their worklist

Page 54: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 54

Assigning a Test Package to a User

Click here

Page 55: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 55

Exercise 6

Page 56: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 56

Summary

The SAP Solution Manager provides functions for definingand managing test projects

You can use the built-in capability of eCATT to createautomated test cases for the SAPGUI environment at minimal cost of ownership

Page 57: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 57

Further Information

Public Web:SAP Developer Network: www.sdn.sap.com Forums SAPGUI

Related Workshops/Lectures at SAP TechEd 2006ULM300: eCATT: Some Frequently-Asked-Questions ExplainedCD211: Testing Tools – eCATT, Mercury QuickTest Pro and Mercury QualityCenterCD261: Testing Web Dynpro Applications and Web ServicesULM218: SAP Test Data Migration Server: Creating Non-ProductionSystems With a Reduced Set of Data

Related SAP Education Training Opportunitieshttp://www.sap.com/education/CA611: Test Managment with eCATT

Page 58: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 58

THANK YOU FOR YOURATTENTION !

QUESTIONS – SUGGESTIONS – DISCUSSION

Page 59: ULM150+ +Automated+Functional+Testing+Using+eCATT+in+SAP+Solution+Manager

© SAP AG 2006, SAP TechEd ’06 / ULM150 / 59

Please complete your session evaluation.

Be courteous — deposit your trash, and do not take the handouts for the following session.

Feedback

Thank You !