Performancing Metrics

Vamsi Tokala's blog: Debugging SAP scripts using SAPGUI Spy in LoadRunner

Thursday, September 2, 2010

Debugging SAP scripts using SAPGUI Spy in LoadRunner

SAPGUI Spy tool comes with LoadRunner installation and be can used to identify each of the SAP GUI Client objects. It will help to understand the properties of the objects while creating and debugging the SAP LoadRunner scripts.

LoadRunner stores the properties of the objects used in the script in lr_strings.h header file

Usage of the tool is explained using the following Code snippet

The below is a sample code which  presses 'Yes' button in a pop up window. and the script failed to press the button during execution.







Property for button btnSPOP1 is defined in lr_strings.h as below

const char* btnSPOP1=


Property of the btnSPOP1 button is replaced with the below property in lr_strings.h after verifying the using SAPGUI Spy tool as shown the snapshot below

const char* btnSPOP1=



Tool can be found under the following path
Additional Components\SAP_Tools\SapGuiSpy


Gerrie Holtzhausen said...

The only problem I have is that the SAPGUI Spy only works when you have established a connection...
So you are not able to use it when trying to establish the window popup for entering a new password.
I have created test users and need to change the passwords, and tried doing to by recording a script but LR does not record the newly capture passwords.

/*Before running script, enter password in place of asterisks in logon function*/


sapgui_logon("ASAPTEST006", //user
"*****",//1st passw

Gerrie Holtzhausen said...

Please notify me if you have a solution in order to record the popup for setting the new password.

Vamsi Tokala said...

I don't have a solution but there are tools available in the market which can capture the object charecteristics.

Bacially you just need to call win Api functions to get object details.

Sahil said...


Is there something like the object spy in QTP which I can just use in case of SAP UI to get the VB object names?

Thanks a lot,