Performancing Metrics

Performance 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.



sapgui_select_active_window("wnd[1]");

sapgui_press_button("Yes",

btnSPOP1,

BEGIN_OPTIONAL,

"AdditionalInfo=sapgui1036",

END_OPTIONAL);;



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

const char* btnSPOP1=

"usr/btnSPOP-OPTION1";



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=

"/app/con[0]/ses[0]/wnd[1]/usr/btnSPOP-OPTION1";

SAP GUI


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

5 comments:

Unknown 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*/

lr_think_time(41);

sapgui_logon("ASAPTEST006", //user
"*****",//1st passw
"584",
"EN",
BEGIN_OPTIONAL,
"AdditionalInfo=sapgui1023",
END_OPTIONAL);


Unknown 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...

Hey!

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,
Best,
Sahil

Anonymous 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. You should visit here to know more information from here.
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.
sap consulting agency