SAP Solution Manager How-To Guide End User Experience Monitoring Script Editor Applicable Releases: SAP Solution Manager 7.1 SAP Solution Manager Scenario: Technical Monitoring End User Experience Monitoring Version 1.0 October 2010
Copyright 2011 SAP AG. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors. Microsoft, Windows, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation. IBM, DB2, DB2 Universal Database, OS/2, Parallel Sysplex, MVS/ESA, AIX, S/390, AS/400, OS/390, OS/400, iseries, pseries, xseries, zseries, z/os, AFP, Intelligent Miner, WebSphere, Netfinity, Tivoli, Informix, i5/os, POWER, POWER5, OpenPower and PowerPC are trademarks or registered trademarks of IBM Corporation. Adobe, the Adobe logo, Acrobat, PostScript, and Reader are either trademarks or registered trademarks of Adobe Systems Incorporated in the United States and/or other countries. Oracle is a registered trademark of Oracle Corporation. UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group. Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc. HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C, World Wide Web Consortium, Massachusetts Institute of Technology. Java is a registered trademark of Sun Microsystems, Inc. JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape. MaxDB is a trademark of MySQL AB, Sweden. SAP, R/3, mysap, mysap.com, xapps, xapp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary. These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty. These materials are provided as is without a warranty of any kind, either express or implied, including but not limited to, the implied warranties of merchantability, fitness for a particular purpose, or non-infringement. SAP shall not be liable for damages of any kind including without limitation direct, special, indirect, or consequential damages that may result from the use of these materials. SAP does not warrant the accuracy or completeness of the information, text, graphics, links or other items contained within these materials. SAP has no control over the information that you may access through the use of hot links contained in these materials and does not endorse your use of third party web pages nor provide any warranty whatsoever relating to third party web pages. SAP Solution Manager How-to Guides are intended to simplify the product implementation. While specific product features and procedures typically are explained in a practical business context, it is not implied that those features and procedures are the only approach in solving a specific business problem using SAP Solution Manager. Should you wish to receive additional information, clarification or support, please refer to SAP Consulting. Any software coding and/or code lines / strings ( Code ) included in this documentation are only examples and are not intended to be used in a productive system environment. The Code is only intended better explain and visualize the syntax and phrasing rules of certain coding. SAP does not warrant the correctness and completeness of the Code given herein, and SAP shall not be liable for errors or damages caused by the usage of the Code, except if such damages were caused by SAP intentionally or grossly negligent. Disclaimer Some components of this product are based on Java. Any code change in these components may cause unpredictable and severe malfunctions and is therefore expressively prohibited, as is any decompilation of these components. Any Java Source Code delivered with this product is only to be used by SAP s Support Services and may not be modified or altered in any way.
Document History Document Version Description 1.00 First official release of this guide
Typographic Conventions Icons Type Style Description Icon Description Example Text Words or characters quoted from the screen. These include field names, screen titles, pushbuttons labels, menu names, menu paths, and menu options. Caution Note or Important Example Recommendation or Tip Cross-references to other documentation Example text Emphasized words or phrases in body text, graphic titles, and table titles Example text File and directory names and their paths, messages, names of variables and parameters, source text, and names of installation, upgrade and database tools. Example text User entry texts. These are words or characters that you enter in the system exactly as they appear in the documentation. <Example text> Variable user entry. Angle brackets indicate that you replace these words and characters with appropriate entries to make entries in the system. EXAMPLE TEXT Keys on the keyboard, for example, F2 or ENTER.
Table of Contents 1. Scenario... 1 2. Definitions... 1 3. Prerequisites... 1 4. Download EEM Editor and Script Recorder... 1 5. Script Design... 2 5.1 Functional consequences... 2 5.2 Performance consequences... 2 5.3 EEM script deadlock... 2 6. Record Transactions... 2 6.1 Record HTTP transaction... 3 6.2 Record SAP GUI transactions... 4 6.3 Create EEM project and import recording... 4 7. Configure EEM Scripts... 6 7.1 Configure an EEM script for HTTP transactions... 6 7.1.1 Activate proxy access for HTTP script... 6 7.1.2 Activate or deactivate static requests in an EEM script for HTTP transactions... 7 7.1.3 Specify response checks for HTTP script... 7 7.1.4 Optional: Import HTTP script certificates... 9 7.1.5 Create variables... 11 7.1.6 Optional: Specify language preference... 14 7.1.7 Optional: Create globally-valid negative HTTP response checks... 14 7.2 Configure EEM script for SAP GUI applications... 14 7.2.1 Enter SAP GUI script connection data... 15 7.2.2 Add response checks... 16 8. Upload EEM Scripts and Trust Store to SAP Solution Manager... 19 8.1 Get connection data... 19 8.2 Upload EEM script or global trust store... 19 8.2.1 Upload EEM script (and global trust store)... 19 8.2.2 Download and update trust store from SAP Solution Manager repository... 20 9. Troubleshooting... 21 9.1 Load EEM robot execution log into EEM editor... 21 9.2 Compare EEM script execution logs... 21 10. Export EEM Script... 23
... www.service.sap.com/solutionmanager 1. Scenario The End User Experience Script editor (EEM editor) is part of End User Experience monitoring. With the EEM editor, you create EEM scripts, which you have recorded with the SAP GUI Script Recorder or the End User Experience Script Recorder. This ensures that the EEM script can be run by the EEM robots. 2. Definitions An EEM script simulates a business transaction, as HTTP or SAP GUI transactions The EEM script comprises one or more steps. A step is a click in an HTTP transaction, or a dialog step in a SAP GUI transaction. A step comprises one or more messages. A message can be: a request sent to the server, and a response from the server. a command, for example a Reset, which deletes cookies or empties the browser cache at the end of a session. A message has parameters (e.g. connection data) fixed contents (e.g. message texts) and dynamic contents (e.g.session IDSs). The creation of a generic EEM script for HTTP or SAP GUI transactions comprises the following steps: Specify connection data for access to the application server. Create response checks, to check the existence of specified contents. Create variables for the dynamic contents at runtime. 3. Prerequisites The 32-bit version of JRE 5 or higher on you local PC. 4. Download EEM Editor and Script Recorder To be able to record and edit EEM scripts, you must download the script recorder for HTTP scripts, and the EEM editor. 1. Follow the instructions in SAPNote 1475198 2. Extract the installation files EemEditor-win32.win32.x86.zip and EEMRecorder.zip into a temporary directory. 3. Open the directory eemeditor, in your temporary directory.
4. Optional: You can adjust the configuration file EemEditor.ini, if you have several versions of JDK/JRE installed in parallel. Note You can have several versions of JRE installed in parallel. In this case, you must enter the path to the JRE 5 in the configuration file EemEditor.ini, to be able to use the end user experience script editor. 5. Run the installation file EemEditor.exe. 6. Run the installation file SAPClientPlugin<SP numbmer>_eem.exe. 5. Script Design The creation of EEM scripts is affected by end user experience monitoring. 5.1 Functional consequences Running EEM scripts can affect your production system. If, for example, you place orders and create shopping baskets, you must ensure that no goods are actually delivered. You can, for example, create test users, or deactivate the order confirmation step in the EEM script. 5.2 Performance consequences Running EEM scripts can impair the performance of your production system. If, for example, an EEM script creates sessions for the same user at regular intervals, but does not close them, performance is impaired. Ensure that the EEM script closes sessions again. Also always put a log out step in your EEM scripts, to end the session in the server. 5.3 EEM script deadlock An EEM script can be run by several EEM robots at the same time. If the same user account is used, this can block other executions of the EEM script. You can specify the start time of the robot in the EEM administration, to avoid deadlocks. 6. Record Transactions You can record click sequences and user input, to create EEM scripts. You import the recordings into the EEM editor and assign them to a project. An EEM script comprises any number of steps. Note In EEM monitoring terms, a step is an SAP GUI dialog step, or a network active click in the HTTP browser, for example a logon process which ends with a click.
6.1 Record HTTP transaction Prerequisites You have downloaded the file SAPClientPlugin.zip, and unpacked it into a local directory, during the EEM set up. 1. Start the file plugin-starter-gui.exe. The EEM Monitoring Recorder starts. The proposed internet browser is Microsoft Internet Explorer. 2. Choose Assign, to assign the Microsoft Internet Explorer. 3. Close all instances of the Microsoft Internet Explorer. 4. Choose Launch. 5. Microsoft Internet Explorer starts. You go to a dialog box. 6. Enter the name of the EEM script which you want to record, in the Transaction Name field. 7. Choose Start Transaction, to start the recording. 8. Enter a meaningful name for the first step of the EEM script which you want to record, in the field Business Executed Step Name. Recommendation SAP NetWeaver BW reporting sorts the transaction steps in alphabetical order. Number the steps in the following format: <index>.<step name>, e.g. 01_login, so that the sequence remains visible. 9. Start the first step of the transaction. Caution Continuing or ending the process too soon can cause transaction recording errors. Do not create a new step while the EEM Monitoring Recorder is still sending or receiving data. 10. Choose New Step, to record another step. 11. Choose Stop Transaction, to end recording. 12. Choose Exit, to close the EEM recorder. Recommendation You may want to record logging out, under the following conditions: There is no Log Out pushbutton. Choosing the Log Out pushbutton would close the browser.
In this case, you can: Go to any internet page. A logout request is sent. Delete the messages which were sent to the second internet page, after importing the script into the EEM editor. Before starting recording, open a second tab in the Microsoft Internet Explorer. Record the transaction in the first tab. Close the second tab, to record both the log out and closing the window. The unused second tab keeps the browser open. The recording of the transaction is saved in a subdirectory of the directory you specified, and can be imported into the EEM editor. 6.2 Record SAP GUI transactions Prerequisites SAP GUI scripting: The profile parameter sapgui/user_scripting=true is set (transaction RZ11 or RZ10). Note You do not need to record logging in and out. Messages are generated automatically. 1. Choose Customize Local Layout Script Recording and Playback. 2. Choose Record Script. The SAP GUI recorder starts. 3. Specify the target directory for the script, in the field Save to. 4. Choose Record Script, to start the recording. 5. Run the transaction in SAP GUI. 6. Choose Stop Recording, to end the recording. The recording of the transaction is saved in the selected directory, and can be imported into the EEM editor. 6.3 Create EEM project and import recording You import the recording of a transaction, to convert it into an EEM script. Group EEM scripts in projects, for comprehensibility. Grouping in EEM projects can, for example, distinguish between EEM scripts depending on whether they are for technical scenarios, system roles (production or test system) or customers.
Prerequisites Recommendation To group EEM projects, you can combine them into work sets, for example, create an EEM project for each technical scenario, and put the EEM projects in work sets for production and test systems. You have recorded a SAP GUI or HTTP transaction. 1. In the directory eemeditor, run the file EemEditor.exe. The EEM script editor starts. 2. Create a project: 3. Choose File New Project. You go to a dialog box. 4. Enter a project name. 5. You can assign the project to a work set: a. Select the field Add project to working sets, b. Select the work set to which you want to assign the EEM project, or choose Select, to create a new work set. c. Choose Finish. The project is created. 6. Create a script: a. Select a project. b. Choose File Import Recording. c. You go to a dialog box. d. Open the folder in which you have saved the SAP GUI or HTTP script. e. You can: to import an SAP GUI script, choose the file <file name>.vbs. to import an HTTP script, choose the file BusinessTransaction.XML. f. Choose OK. The recording of the transaction is converted into EEM script format and assigned to an EEM project as an EEM script.
7. Configure EEM Scripts An EEM script for HTTP transactions which you have created by importing the recording of a transaction, contains instance-specific information, e.g. GUIDs or Session IDs. This information is dynamic, it changes each time a the transaction runs. This information is automatically replaced by variables, when you import the recording, so that EEM robots can run EEM scripts. When the EEM scripts run, the variables are replaced by dynamic contents, e.g. the actual session ID is put in the corresponding variable. In the same way, for example user IDs and passwords to access systems, are replaced by variables in the EEM scripts for SAP GUI transactions. At runtime, the variables are given values which you configured manually. So configuring an EEM script means creating a generic script. 7.1 Configure an EEM script for HTTP transactions Create a generic EEM script for HTTP transactions. Prerequisites You have created an EEM project, imported the recording of an HTTP transaction, and assigned it to a project. Process Creating an EEM script for HTTP applications comprises the following steps: 1. Activate proxy access, if required. 2. You can deactivate static requests. 3. Specify response checks. This ensures that the desired content is transferred from the server. 4. You can assign certificates to EEM scripts. 5. Replace dynamic IDs with variables, if required. 6. You can specify a language. 7. You can specify globally-valid negative response checks. 7.1.1 Activate proxy access for HTTP script You usually have to activate proxy access, so that EEM scripts which communicate with external HTTP servers can be run. Prerequisites You have created an EEM script for communication with an external HTTP server.
1. Choose Open in the context menu of the script, to open it. 2. Choose Script Script Configuration. You go to a dialog box. 3. Activate proxy access: a. Choose HTTP Proxy Setting in the hierarchy. b. Select the field Enable. c. Specify the proxy host and the proxy port. 4. Choose OK. 7.1.2 Activate or deactivate static requests in an EEM script for HTTP transactions Static page elements contain no relevant content. They are saved in the cache of the internet browser, to accelerate the loading of an HTML page when it is opened repeatedly. To simulate the response times of the user realistically, you can activate or deactivate static page elements, depending on the application: Typical users open some HTML pages repeatedly, so when you import a recording, static requests, which are saved in the cache of the internet browser during recording, are deactivated by default. If the EEM script is to simulate the behavior of users who open an HTML page for the first time, (e.g. web shop customers), activate static requests. 1. To deactivate static requests, choose Script Hide Static Messages. 2. Ensure that only graphics with no relevant contents are deactivated. Do not deactivate business graphics which are generated dynamically, such as graphical analyses of business trends, which are generated by SAP Netweaver Business Warehouse. 3. To hide inactive static requests, choose Script Hide Unselected Messages. 7.1.3 Specify response checks for HTTP script Response checks ensure the consistency of an EEM script. You check the contents of the response for EEM scripts for HTTP transactions, using text checks which you create. Background: A response to a request can be technically correct, but the contents may not match your expectations. With text checks, the EEM script checks whether a transaction ran successfully. The EEM script checks whether a response contains a specified character string.
Recommendation To ensure that an EEM script can simulate the transaction completely and correctly, create at least one response check for each step in the transaction. To be able to use End User Experience Monitoring, you must create at least one text check, with which the EEM script can check whether the transaction ran successfully, in each EEM script. An EEM script which simulates the creation of a request, must, for example, contain a text check which checks whether, for example, the following text is output: Request created. With text checks, an EEM script can check whether: an expected text is output. Example A vacation request form is created formally correctly, but cannot be processed, because the vacation period requested is in the past. The HTTP server sends an incorrect response. When the EEM script runs on the EEM robot, the text check determines that, for example, the expected text Request Accepted, is not output, and sends an error message. an unexpected text is output. Example A web server is unavailable, because of maintenance, but sends a response, because the administrator has activated a static HTML page. You specify response check texts which must not be output, for example, Server is not available, so that the EEM monitor can determine that the web server is not available, and send an error message. Note This behavior can be suppressed in Work Mode Management. The EEM robot does not run the EEM script during planned downtime. 1. To open the script, choose Open in its context menu. 2. Select a message with the relevant text (e.g. MIME content of type text/html) and choose Browse Record Response in the context menu. The recorded content is displayed. Note Only the objects for this message are displayed, so an HTML page does not appear, as it does in an internet browser. You can only display individual messages, e.g. the HTML content, but not the associated GIF files. 3. Select a representative text, e.g. the term Password in a logon screen, and choose Copy in the context menu. 4. Create the text check, manually or automatically: Create the text check manually:
a. Click on the message in the Checks column, and click on the icon which appears in the cell. b. You go to the Edit Text Check dialog box. c. Insert the copied text in the Plain Text Check tab. Caution The EEM script searches in the HTML source code, in which special characters are represented by HTML entities, e.g. the German umlaut ü, by the entity ü. Replace the special characters with with entities, according to the HTML character reference, or create the text check automatically. Create the text check automatically. You can search transactions with a lot of messages, to identify the message which contains the specified character string. d. Choose Script Add Text Check for Transaction Step. A dialog box appears. e. In the Scope field, select the transaction step in which the character string is to be searched for. f. Enter the character string to be searched for, in the Search field. g. Choose Search. A list of text fragments in the HTML file which contain the character string, is displayed. h. Select the section containing the character string searched for. 5. Choose OK. 6. The Checks column shows the number of text checks which you have created for the message. 7. Choose File Save, to save the EEM script. For further information about creating negative response checks for all EEM scripts, see 7.1.7 Optional: Create globally-valid negative HTTP response checks. 7.1.4 Optional: Import HTTP script certificates EEM scripts can validate the security certificates used to authenticate server and client hosts, if you use HTTP via SSL or TLS. The certificates are imported, saved in a trust store, and uploaded into the SAP Solution Manager EEM script repository. Note Authentification does not affect realistic simulation of user behavior significantly, so installing certificates is optional, but you can ensure that all certificates are up-to-date, in this way. To simplify the creation of EEM scripts, you can ignore server certificates: i. Choose Script Script Configuration Advanced. ii. Assign the value true to the parameter HTTP.ignoreCertificate.
You can import two types of server certificates: certificates from a certificate authority (CA certificates), or server certificates which are signed by a CA certificate. Typically, you save CA certificates in the EEM editor global trust store, and server certificates in the trust store of the EEM script. CAUTION When you upload a trust store into the SAP Solution Manager repository, the previous version is overwritten. To avoid version conflicts (e.g. if several people configure EEM scripts), only save CA certificates in the global trust store. For further information about avoiding version conflicts when uploading the global trust store, see section 8, Upload EEM Scripts and Trust Store to SAP Solution Manager. Import server certificate 1. Download the certificate: a. Start the Microsoft Internet Explorer. b. Choose Tools Internet Options. c. In the Content tab, choose Certificates. You go to a dialog box. d. In the Intended Purpose field, choose Client Authentication. e. In the Trusted Publishers tab, select the certificate. f. Choose Export. You go to the Certificate Export Wizard dialog box. g. Export the certificate in the format DER encoded binary X.509. 2. Import the certificate: a. Open the EEM script. b. Choose Script Script Configuration. A dialog box opens. c. In the hierarchy, choose HTTP Certificate Management. d. In the Configuration Scope field, specify the validity range: to save a CA certificate in the global trust store, choose Global. to save a server certificate in the EEM script trust store, choose Script. e. Choose the Trusted Root Certification Authorities tab. f. Choose Import. g. Choose the certificate which you have downloaded from the homepage.
h. Choose Open. The certificate is imported into the selected trust store. i. Choose OK. Import client certificate 1. Download the certificate from the homepage which the EEM script is to call: a. Go to the homepage in Microsoft Internet Explorer. b. Choose Tools Internet Options. c. In the Content tab, choose Certificates. You go to a dialog box. d. In the Purpose field, choose Client Authentication. e. Choose the Personal tab. f. Select the certificate. g. Choose Export. You go to the Certificate Export Wizard dialog box. h. Select the field Yes, export the private key. i. Enter a password, and export the certificate. 2. Import the certificate: a. Open the EEM script. b. Choose Script Script Configuration. A dialog box opens. c. In the hierarchy, choose HTTP Certificate Management. d. In the Configuration Scope field, specify the validity range Script. e. Choose the Personal tab. f. Choose Import. g. Choose the certificate that you have downloaded from the homepage. h. Choose Open. The certificate is imported into the selected trust store. i. Choose OK. 7.1.5 Create variables In EEM scripts for HTTP transactions, dynamic contents, such as unique session IDs, are put in variables at runtime. This allows EEM scripts to be reused. The EEM script editor is delivered with a set of rules to insert variables automatically. These replace typical dynamic contents. If you cannot run
an EEM script because an SAP or third-party product uses dynamic IDs which are not covered by the rules delivered, you must create a variable. Example The response of a message contains a generated URL with a unique ID, with the name sap-contextid. Do the following, so that the EEM robot reads the value of the ID sapcontextid from the response, and puts it in a variable: Check the location of the ID in the HTML context, and specify a search pattern to identify and read it. For example, delimit the ID at the left-hand side with the string sap-contextid=, and at the right-hand side with the string &. Create a variable, into which the contents of the ID sap-contextid is read, e.g. of the form "sap-contextid=(contextid_27)". 1. Identify the ID to be replaced by a variable: a. Identify and select the request which caused the error. b. Choose Edit Message in the context menu, and identify IDs in the URL or the parameters. c. Select part of the delimiting string of the ID, e.g. sap-contextid=, and choose Copy in the context menu. d. Choose Cancel. 2. Identify the instance number of the occurrence of the delimiting text of the ID, in the HTML text of the recording: a. Select the message in which the ID first occurs. b. Choose Search/Text Check in the context menu. c. Enter the ID delimitation character string from the clipboard, and choose Search. The hits are shown in the Context column. If the character string is found once, the instance number is 0. d. If the character string was found more than once, count the hits as follows: i. In the column Req. #, identify the number of the requests in which the hit occurs. ii. e. Choose Cancel. Count, beginning with 0, in the request, to the hit. 3. In the Search column, double-click on the step. You go to the Edit Searches dialog box. a. Choose New Text Search. b. In the Search Attributes area, in the Name field, enter the name of the ID whose contents the EEM robot is to read, and write into the variable, e.g. sap-contextid.
c. In the fields Left-Bound and Right-Bound, specify the strings which delimit the ID to left and right, in the HTML text, e.g. sap-contextid= to the left, and & to the right. Important The delimiting text must match the HTML source text exactly. Tip If you are familiar with the syntax of regular expressions, specify the strings of the delimiting texts to the left and right of the variables, in the Define Pattern field. You must specify, in (parentheses), three groups for the left-hand delimiting text, the ID and the right-hand delimiting text, according to the following schema: (<left-hand delimiting text>)(<id>)(<right-hand delimiting text>), e.g. (sapcontextid=)(.*)(["&]). For further information about regular expressions, see HTTP://java.sun.com/javase/6/docs/api/java/util/regex/Pattern.html. 4. To create the variable into which the EEM robot is to write the contents of the ID at runtime, proceed as follows: a. Choose the pushbutton New, next to the table. You go to the Edit Matches dialog box. b. Enter the required data: i. in the Variable Name field, enter the names of the variables, e.g. contextid_27. ii. in the Instance no. field, enter the sequential number of the occurrence of the string in the HTML text, identified in step 2. c. Confirm with OK. You return to the Edit Searches dialog box. d. Choose OK. 5. Enter the variable in the EEM script: a. Select the first request in which the ID is to be replaced by the variable. b. Choose Edit Message in the context menu. c. Replace the ID with the name of the variable, in curly brackets, e.g. {contextid_27}. d. Choose OK. e. Repeat steps a to d for each request in which the ID occurs which you must replace with the variable. Note If you need to specify the same searches for several EEM scripts, you can specify a new rule to insert variables automatically. For further information, see the section AutoParam Rules under https://wiki.sdn.sap.com/wiki/display/eem/home.
7.1.6 Optional: Specify language preference When you import a recording, its language setting is copied. You can change it, to ensure that your response checks work. Example You have recorded a script in an American user interface. When you run the EEM script, the text checks no longer work, because only German HTTP contents are accepted. You add an American language preference. 1. Choose Script Script Configuration. 2. In the hierarchy, choose HTTP Request Headers. 3. In the Configuration Scope field, choose Global. 4. Enter the codes of the preferred languages, separated by commas, in the Accept Language parameter, e.g. put the value en-us first, if American is the preferred language: en-us,de. 5. Choose OK. 7.1.7 Optional: Create globally-valid negative HTTP response checks The EEM editor is delivered with a set of global standard text checks for all EEM scripts, to which you can add. 1. Choose Script Script Configuration. 2. In the hierarchy, choose HTTP Checks. 3. In the Configuration Scope field, choose Global. 4. In the Text Check Content column, enter a character string. 5. Choose OK. 7.2 Configure EEM script for SAP GUI applications Create a generic script for SAP GUI transactions. Creating an EEM script for SAP GUI transactions comprises the following steps: 1. Enter the connection data for access to the application server.
2. Recommendation: Specify response checks. 7.2.1 Enter SAP GUI script connection data EEM robots can only run scripts which you have recorded with the SAPClient plug-in or the SAP GUI recorder, when you have added the character string for connection to an application server. There are the following types of connection data: simple connection data (e.g. user and password) Connection data for connection via message server, log-on groups or symbolic names 7.2.1.1 Specify simple connection data 3. To open the script, choose Open in the context menu of the script. 4. Choose Script Script Configuration. You go to a dialog box. 5. In the hierarchy, choose Variables. 6. In the Configuration Scope field, choose the connection variable Script as validity range. The connection data variables are displayed. 7. Enter the connection data in the following variables: sapgui.client sapgui.language sapgui.password sapgui.user 8. If the connection is not via message server, logon groups or symbolic names, enter the host name and the system number. Enter this connection data in the following variables: sapgui.host sapgui.sysno 9. End with OK. 7.2.1.2 Enter connection data for connection via message server, logon groups or symbolic names Enter message server, logon groups or symbolic names in the EEM script source text: 1. To open the script, choose Open in the context menu of the script. 2. Select step 1 (OpenConnection). 3. In the context menu, choose Edit Message. You go to a dialog box.
Text-C hecks hinzufügen www.service.sap.com/solutionmanager 4. Edit the parameter url: Enter the host name of a message server, with the prefix /M/ Enter the port number of a message server, with the prefix /S/ Note To get the port number, open the file /usr/sap/sid/instance/work/dev_ms, in the central instance of the system: i. Start transaction AL11. ii. iii. Choose DIR_HOME dev_ms. Search for an entry of the type: [Thr 47001110914576] *** I listen to port sapms<sid> (<port number>) *** Enter the name of a logon group with the prefix /G/ Enter the symbolic name of an SAP system, with the prefix /R/ CAUTION If you connect via a symbolic name, you must ensure that the symbolic name is assigned to the host name in the ini file of the host in which the EEM robot runs the EEM script. Example 5. Confirm with OK. Edit the parameter URL according to the following schema: url="/m/<host name>/s/<port number>/g/<logon group>" For further information about connection data, see the SAP GUI documentation. 6. Choose the File Save. 7.2.2 Add response checks You can create positive or negative response checks. You ensure that either a specified character string occurs in a specified user interface element (positive response check), or that a specified character string or an error message do not occur. You can create the following types of response check: Simple SAPGUI check: To ensure that specified character strings occur (e.g. Order created ), or do not occur (e.g. Logon error ), in one specified user interface element. Table and report check: Check whether a column in a table or ABAP list contains a specified character string. For example, to check whether a user has a specified role. Specify the following parameters: StartRow: Specify by mouse click in single step mode, the row from which the table or list is to be searched. ColumnIndex: Specify by mouse click in single step mode, the column to be checked.
Value SearchText: Specify the text to be searched for in the table or list, manually. SAPGUI Status Bar Check: Ensure that specified message types do not occur, e.g. E (error) or A (alert). You can check for the following message types: Description S W E A I Success Warning Error Abort Information 7.2.2.1 Add SAP GUI check in single step mode You can create response checks most conveniently in single step mode, by clicking in the user interface while checking the user interface elements step-for-step. A red frame in the user interface shows which step was last performed. 1. Choose Script Run Script Step by Step. 2. In the message display area, choose the SAP GUI Content tab. In the Screenshot tab, a screenshot is displayed. 3. Choose Script Run Script Step by Step, until a red frame indicates the user interface element which you want to add as response check. 4. Click on the red frame. The response check is created. To create a report check, click on a column in the first row of the report. 5. Edit the response check manually: Enter the character string to be searched for. Optional: A negative response check ensures that the specified character string does not occur. For further information, see section 7.2.2.4. Create or edit response check manuall. 6. Choose File Save. 7.2.2.2 Add SAP GUI check in component trace 1. Choose Script Script Configuration. You go to a dialog box. 2. In the hierarchy, choose SAPGUI.
3. Select the Component Trace field. 4. End with OK. 5. Choose Script Run Script. 6. In the message display area, choose the SAP GUI Content tab. The Dump tab shows the user interface element hierarchy. 7. Select a step for which to create a response check. 8. To add a check for a text, choose the corresponding option in the context menu. You can search for the text in various attributes of the element, depending on the instance of the element in the user interface. 9. Enter the character string whose occurrence you want to check. 10. Optional: Create a negative response check, to ensure that the specified character string does not occur. For further information, see section 7.2.2.4. Create or edit response check manuall. 11. Choose File Save. 7.2.2.3 Create Status bar check 1. Choose Script Script Wizard. 2. Select Generate Status Bar Checks for SAPGui Script Messages. 3. Choose OK. 4. Choose Finish. For each message, two automatic negative response checks, for messages of type E (Error) and A (Alert) are created. The EEM robot creates an error message if the message type occurs. 5. To edit the automatically-generated status bar check, click in the Check column of the step. 7.2.2.4 Create or edit response check manually 1. Click in the Check column of the step. 2. You go to the Edit Checks dialog box. 3. Choose a tab, depending on the response check type. 4. Enter the character string whose occurrence you want to check. 5. To generate an error message if the character string occurs, choose the Negative field. 6. Choose OK.
8. Upload EEM Scripts and Trust Store to SAP Solution Manager You upload EEM scripts into the EEM script repository, to distribute them to EEM robots. To upload the global trust store, upload at least one EEM script. 8.1 Get connection data To be able to upload EEM scripts or the global trust store into the EEM script repository, get the connection data for your Solution Manager system. 1. Choose File Editor Configuration. You go to the Script Configuration dialog box. 2. In the hierarchy, choose Editor Solution Manager Connection. 3. Enter the required data. 4. Choose Apply. 5. To check the connection data, choose Test Connection. 8.2 Upload EEM script or global trust store Run an EEM script before you upload it to SAP Solution Manager, to distribute it to your EEM robots, to ensure that the EEM robots can run it correctly. CAUTION Running an EEM script for SAP GUI applications with Component Trace and SAP Hard Copy, impairs performance. Deselect both fields before uploading the executable EEM script to the EEM robots: i. Choose Script Script Configuration. You go to a dialog box. ii. iii. In the hierarchy, choose SAPGUI. deselect the fields Component Trace and SAP Hardcopy. 8.2.1 Upload EEM script (and global trust store) CAUTION To avoid accidentally overwriting an existing global trust store, download the existing global trust store from the SAP Solution Manager repository, first. For further information, see section 8.2.2 Download and update trust store from SAP Solution Manager.
1. Select the EEM script to upload to SAP Solution Manager. 2. Choose Export to EEM Admin. Repository, in the context menu. You go to the Upload Script dialog box. 3. To upload encoded variables which (e.g. passwords), select the field Upload Secure Properties. CAUTION Choose this option if you transfer the data via a secure SSL connection. If you do not transfer the data, you must enter it in the EEM management. For further information, see the End User Experience Monitoring online documentation. 4. To upload the global trust store in which you have, for example, saved CA certificates which are valid for all EEM scripts, do the following: Note You can only upload the global trust store by uploading at least one EEM script. a. If several people create EEM scripts, assign responsibility for the maintenance of the global trust store. b. Select the field Upload Global Trust Store. Choose OK. The EEM script is uploaded to the SAP Solution Manager. 8.2.2 Download and update trust store from SAP Solution Manager repository An existing global trust store in the EEM script repository is overwritten when you upload a new global trust store. To update a global trust store, download it from the EEM script repository first, import certificates, and then upload the global trust store with an EEM script, again. 1. Start the Technical Monitoring work center. 2. Choose the End User Experience Monitoring view. 3. Choose Administration. 4. Choose the Global Configuration tab. 5. In the Global Resources area, in the Resource field, choose truststore.jks. 6. Choose Download Resources. You go to a dialog box. 7. Save the file truststore.jks in the local directory in which the EEM editor (EemEditor.exe) is installed.
8. Import, for example, a CA certificate that you want to add to the global trust store. For further information, see section 7.1.4 Optional: Import HTTP script. 9. Upload an EEM script, with the updated trust store, to the SAP Solution Manager. The previous state of the trust store is overwritten. 9. Troubleshooting Prerequisites Connection data. For further information, see section 8.1 Get connection data. 9.1 Load EEM robot execution log into EEM editor You load a client execution log into the editor, if problems occur when executing an EEM script in an EEM robot. Check, for example, whether variables for dynamic contents are set up correctly. You can compare the execution log with the execution log of a successful execution of the EEM script. 1. In the EEM monitor, select an execution of the EEM script. 2. In the context menu, choose Copy Transaction ID to Clipboard. 3. In the EEM script editor, choose the Execution History tab. 4. In the context menu, choose Import Logs from Robot (ID in Clipboard). The EEM robot log files are displayed in the replay list. You can analyze the error messages. 9.2 Compare EEM script execution logs To identify errors in an EEM script, you can, for example, compare the execution of an EEM script with the original recording. Or you can compare an execution of an EEM script in an EEM robot which failed today, with a successful execution of the EEM script in the EEM editor, yesterday. You could, for example, recognize that a you need to replace a timestamp with a variable. Prerequisites When you compare SAP GUI scripts, activate the component trace. For further information, see Error! Reference source not found. Add SAP GUI check in component trace. 1. Choose the Execution History tab. 2. Select two executions of the EEM script to compare, e.g. one successful and one failed execution. 3. Choose Compare selected executions, in the context menu. You go to the Compare Message dialog box.
4. To restrict the comparison as far as possible, choose the following options. Ignore missing request/response bodies (on the left/on the right): Use this option when you compare execution logs from an EEM robot. It logs only the parts of the EEM script with errors. You can ignore the omitted error-free parts, to ensure comparability with the EEM editor execution log. Example: The execution log of an EEM script, that you have downloaded from the EEM robot, is displayed at the left-hand side. Select the Ignore missing request/response bodies on the left field. Hide Static Message: Select this field to hide static requests which are saved in the cache of the internet browser. Hide expected variables: Select this field to show dynamic contents such as session IDs, as variables. Auto mapping: If, for example, the execution log of the recording and the EEM script do not match, because static requests are inactive, the EEM editor tries to match the requests in the execution logs. 5. Choose Compare. The differences in the execution logs are listed. You can identify, e.g. the following causes of errors in the comparison: IDs have not yet been replaced by variables. Page contents do not match: The authorization to access contents has changed. The language preferences are not correct. For further information, see section 7.1.6 Optional: Specify language preference.
10. Export EEM Script You can, for example, export an EEM script during a service. 1. Select the EEM script. 2. Choose Export in the context menu. 3. Specify the storage options. 4. Choose Finish.