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
.png)
This will show you a launch pop-up.
.png)
Click on the "record" button to start the recording
.png)
Once this is done, perform your manipulations and then click on the "stop" button to end the recording.
.png)
Once the capture is finished, a page with all your actions in vbscript format will open automatically.
.png)
To replay this script, click on the "play" button.
.png)
This will open your Windows Explorer and the folder containing your script.
.png)
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.

Scripting action in Agilitest
From Agilitest, you can also create actions in vbscript format and interact with SAP.
Two ways are possible:
- 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.
.png)
Then click on the “Scripting” action
.png)
There is no need to specify an interface element.
.png)
Click directly on the "Scripting" action and paste the script line
.png)
2. Either by manually creating vbscript actions using the properties
Click on the "Scripting" action.
.png)
Add an interface element and enter a value that will act on this element
.png)
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.
.png)
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.