Monday 3 December 2018

SAP GUI Scripting parameter - Automation Testing

By default SAP GUI doesn't allow automation test recording/playback due to security reasons. We have to explicitly enable following few parameters to allow these options.

SAP GUI Scripting contains the following 2 level of security mechanisms:

On the server:

Profile parameters whose setting determines whether SAP GUI Scripting should be allowed on the current application server

On the client:

Options in the SAP GUI setup program that make it possible to install SAP GUI without the scripting components.Registry keys that allow scripting to be disabled on the client.

Enabling and Disabling SAP GUI Scripting on the Server

SAP GUI Scripting can be switched on and off for a particular application server (or for dedicated users, see note 983990) using the profile parameter sapgui/user_scripting. By default, scripting is not enabled. To enable scripting, set the value of this profile parameter to TRUE. You do not have to restart the server, but you must log off and back on again, since the change does not affect sessions that are currently running. This setting overrides any client settings.

Additional Profile Parameters in Release 6.40 and higher

As well as sapgui/user_scripting, you can use the following profile parameters for more refined access control in Release 6.40. They are also included in Release 6.20 from support package 37, and in Release 4.6C from support package 47. SAPGUI Release 6.20 patch level 42 or higher is also required.

Profile Parameter                                      -   Description
sapgui/user_scripting_disable_recording  - If this parameter is set to TRUE, script playback is possible, but recording is not permitted.

sapgui/user_scripting_force_notification - If this parameter is set to TRUE, a notification is always displayed at the frontend, regardless of the client options described below under 'Warning Options on Client Side'.

sapgui/user_scripting_set_readonly - If this parameter is set to TRUE, scripts may only act on read-only user interface elements.

Enable scripting at client side:
The user can enable and disable scripting for their own use from path in SAP GUI via  Start of the navigation path: Options->Accessibility & Scripting -> Scripting

Notify when a script attaches to a running GUI: A message appears whenever a script attaches to the SAP GUI

Notify when a script opens a connection: A message appears whenever a script opens a new GUI connection.