SAP GUI Automation - Getting Started

abstract This section details how to test SAP GUI Applications. If you are not familiar with Sahi Pro Flowcharts, see Introduction to Sahi Pro Flowcharts To automate SAP GUI applications using Sahi Pro Classic, refer SAP GUI Automation - Getting Started.

Start SAP GUI Automation

  1. Scripting must be enabled in SAP GUI client.
    1. Open SAP GUI options from top right corner of SAP Logon pad.
    2. Go to Accessiblity & Scripting Select Scripting.
    3. Check the Enable scripting checkbox under User Settings.
    4. Ensure that scripting is not disabled in the Registry for SAP GUI client as follows :
      1. On the Start menu, choose Run.
      2. In the Open box, enter regedit.exe.
      3. In the Registry Editor, check the value for following subkeys. If the value is set as 0, modify it as 1 to enable scripting. Ignore this if the subkeys are not present.
        HKEY_LOCAL_MACHINE\SOFTWARE\SAP\SAPGUI Front\SAP Frontend Server\Security\UserScripting
        HKEY_LOCAL_MACHINE\software\Wow6432Node\sap\SAPGUI Front\SAP Frontend Server\Scripting
  2. Scripting must be enabled in SAP GUI server. Start RZ11 transaction and set the following profile parameters as applicable :-
    1. Parameter sapgui/user_scripting must be set as TRUE.
    2. Parameter sapgui/user_scripting_disable_recording must be set as FALSE. If TRUE, recording will be prohibited.
    3. Parameter sapgui/user_scripting_force_notification must be set as FALSE. If TRUE, SAP GUI server would notify for every scripting activity.
    4. Your SAP administrator may have set parameter sapgui/user_scripting_per_user as TRUE to enable scripting only for specific users. If this parameter is set as TRUE, ensure that your SAP administrator has enabled scripting for you.
    5. Up to patch level 16 of SAP GUI for Windows 7.40 and patch level 3 of SAP GUI for Windows 7.50, parameter sapgui/user_scripting_set_readonly must be set as FALSE. If TRUE, a READ ONLY version of SAP GUI Scripting is activated.
    6. info If you do not have privileges to enable scripting in SAP GUI server, contact your SAP administrator.
  3. Start Sahi Pro Dashboard
  4. Ensure SAP Automation is enabled. Disable SAP Automation link must be visible on Sahi dashbord from the Processes settings. "Sahi SAP agent started!" message appears on Sahi Pro console.

    Feb 19, 2020 2:48:30 PM net.sf.sahi.test.ProcessHelper execute INFO: cmd /C D:\Sahi_Pro\sap\bin\SahiSAP.exe -port=9999 > D:\Sahi_Pro\sap\SAP_log.txt >>>> Sahi SAP agent started! Feb 19, 2020 2:48:40 PM net.sf.sahi.test.ProcessHelper$PIDGatherer run INFO: PIDs: [8668]; 10491 ms
  5. Ensure that in, specifies the correct path for SAP logon pad.

Launch SAP Application from Flowcharts and Element Identification

  1. If SAP automation is not enabled,SAP Automation must be turned on from processses settings from Sahi Pro Dashboard before starting identification or recording.

Automating a Keyword

This is similar to automating a Sahi Pro Flowcharts keyword for normal browser testing.
  • To automate a Keyword, click on a node from the Sahi Pro Flowcharts page, click on the Automate, click on Start Record button, Actions done on the SAP GUI client application are recorded automatically.
  • Steps can also be recorded from the Flowcharts Controller.
  • info
    1. If SAP automation is not enabled, Enable SAP Automation link must be clicked from Sahi Dashboard before starting identification or recording.
    2. Note : A user's interaction with SAP GUI involves communication with SAP server. A communication with SAP server is initiated by SAP GUI at multiple occasions. The most common actions by user that initiate SAP server communication are as follows:
      • Enter key pressed from keyboard
      • Click on Enter button in the toolbar
      • Click on Save button in the toolbar
      While recording with Sahi Pro SAP Add-on, the actions performed in SAP GUI are captured for every such SAP GUI to SAP server communication. Thus the steps get recorded after every Enter key press, Click on Enter button in the toolbar, Click on Save button in the toolbar, etc.

      For example : When recording login operation, we would enter user name, enter password and press enter key from keyboard. In this case, all these three actions will be recorded after enter key is pressed.
    3. Refer Record a steps for a better understanding.


    1. On the Automate dialog click on Runbutton.
    2. The Run Settings dialog opens. Select the Mode SAP and click RUN.

    View Report

    1. Click on the Reports button..
    2. The Report opens in a new browser tab.
    infoNote: A script cannot be played back if SAP automation is not enabled From the Processes setting on Sahi Pro Dashboard.
    infoRefer Run Flowchart for a better understanding.