Categories

SAP scripting

VBscript

SAP recorder in SAP

One of the features offered by SAP is the use of a recorder. Once activated, this function records the actions performed on SAP and then translates them into vbscript.

To launch the capture directly in SAP, go to the options from the drop-down menu: Plus > SAP GUI Options and Actions > Record and Playback Script

sap recorder

This will show you a launch pop-up.

recorder pop-up

Click on the "record" button to start the recording

record button

Once this is done, perform your manipulations and then click on the "stop" button to end the recording.

stop button

Once the capture is finished, a page with all your actions in vbscript format will open automatically.

vbscript

To replay this script, click on the "play" button.

This will open your Windows Explorer and the folder containing your script.

script in windows explorer

By clicking on the script it will perform again the actions that were executed directly on SAP.

To use the vbscript data in Agilitest you have to look at the last lines of your script.

vbscript actions

Scripting action in Agilitest

From Agilitest, you can also create actions in vbscript format and interact with SAP.

Two ways are possible:

  1. Either by using the script lines of the vbscript.

To do this, copt a script line from your vbscript that you want to transform into an action.

line in vbscript

Then click on the “Scripting” action

scripting action

There is no need to specify an interface element.

no element

Click directly on the "Scripting" action and paste the script line

enter text in scripting action

         2. Either by manually creating vbscript actions using the properties

Click on the "Scripting" action.

scripting action

Add an interface element and enter a value that will act on this element

interface element in scripting action

Example : Above, the interface element corresponds to an element in which text can be entered, with the "text" property of this element set to "MIGO".

When the action is executed, this translates into the text MIGO in the text entry on SAP.

"migo" entered in text bar

The difference between these two manipulations is that by passing through a line of code of the vbscirpt the access to the object is done by its id, while by passing through an Agilitest action, the access to the object is done by its properties.

Still require support?
Contact support