NOTICE: Significant community changes coming soon
The header menu and the home page on our community will be changing soon. Get more information HERE.
Highlighted
Contributor.
Contributor.
8145 views

Cannot Replay LoadRunner Script with SAP-WEB and SAPGUI (embeded)

Hi

I am using LoadRunner 9.1 utilising SAP-WEB & SAPGUI dual protocols.

Using VUGen, I am recording a TimeRecording transaction by logging in via SAP Portal and then clicking on the TimeRecording menu which then invokes an embedded SAPGUI session displaying the timesheet to fill out.

LoadRunner records the transaction correctly but encounters errors when trying to replay the script.

The script fails at the point where the SAPGUI is invoked within the portal.

The user credentials used to log on to the SAP Portal cannot be used to log on to a pure SAPGUI session. So, when a user logs on to the portal and invokes the embedded SAPGUI some kind of single-sign-on (SSO) is carried out transparent to the user then sucessfully invoking the SAPGUI.

The following extract was taken from the recorded script;

sapgui_open_connection_ex(" /M/cii0754.XXXXXXXXX.com/S/3654/G/I07 /WP","","con[0]");

sapgui_select_active_connection("con[0]");

sapgui_select_active_session("ses[0]");

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

sapgui_logon("username",
"password",
"006",
"EN",
BEGIN_OPTIONAL,
"AdditionalInfo=sapgui104",
END_OPTIONAL);

sapgui_select_active_window("wnd[0]");

sapgui_set_ok_code("/nCAT2",
BEGIN_OPTIONAL,
"AdditionalInfo=sapgui105",
END_OPTIONAL);


When replaying the LR Script the embedded SAPGUI is invoked, it tries to authenticate the logged in user on the SAPGUI but fails - this is understandable because the user does not have the ability to log on to SAPGUI directly.

So my question is, how do I get LoadRunner to record the transparent SSO so that the SAPGUI does not request credentials?

Error returned during LR playback:
Action.c(464): Error: Logon failed. Verify that the username and password that you provided are valid

Thanks!

RM

 

 

P.S. This thread has been moved from Performance Center Support and News Forum to  LoadRunner Support Forum. -HP Forum Moderator

Tags (1)
0 Likes
12 Replies
Highlighted
Absent Member.
Absent Member.

First Close the open session before execution the scripts. It wont allow multiple sessions.

Second you have to install SAP Client.
0 Likes
Highlighted
Contributor.
Contributor.

There are no other sessions open and the SAP GUI Client is installed.

My main issue here is with regards to the SSO event happening in the background transparent to LoadRunner i.e. when SAPGUI is invoked from starting the TimeRecording transaction from within the SAP Portal. LoadRunner fails to capture and replay this correctly.
0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

My bet is that the Portal and R3 passwords are different for the users. Talk to the DBA and ask for both passwords. Then substitute the R3 password in the sapgui_logon function.

-Terri
0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Hi,
First check the saplogon.ini file.request ur sap administrator to check that.SAP GUI should be installed in ur machine then SAP GUI scripting should be enabled,
Then check the User id is in Sap server and portal servers.All the user id should be in sap gui and sap apps server.

If you are trying to do ur scrits through sap gui to sap web.SAP web use should be in sap server and portal servers.All the users should be in both the system.

now use web_set_user function use for single sign on.



0 Likes
Highlighted
Absent Member.
Absent Member.

I'm having the same issue, did you ever find a resolution for this?
0 Likes
Highlighted
Absent Member.
Absent Member.

Hi,
You are connecting to the SAPGUI using SAP Logon Ticket to authenticate yourself, therefore your script has to keep the credentials and continue this way. The (" /M/cii0754.XXXXXXXXX.com/S/3654/G/I07 /WP","","con[0]");
opens a brand new connection, so new authentication, which is not desirable in this case, because it demands again username and password. Your system details are:
SID=I07
transaction=CAT2
client=006
correct?


HP brought me a hint leading to this solution
Capture MYSAPSSO2 into parameter as plain text

Modify your sapgui_open_connection_ex():
gui_open_connection_ex("/SHORTCUT=\" -gui=/M/cii0754.XXXXXXXXX.com/S/3654/G/I07 /WP\" -sid=I07 -clt=006 -cmd=\"CAT2\" -t=Transaction -wp=true -l=EN -reuse=0 -at=\"MYSAPSSO2={MYSAPSSO2_plain_text}","","con[0]");

Comment the sapgui_logon()
Comment the sapgui_set_ok_code("/nCAT2",
Comment sapgui_send_vkey(ENTER . after CAT2
Comment the last web_*() before gui_open_connection_ex() having RecContentType=application/vnd.sap-gui


good luck
0 Likes
Highlighted
Absent Member.
Absent Member.

Hi

In the sapgui_logon() replace the actual SAP GUI password for the corresponding userlogin through portal. You can obtain this information from the BASIS team.

I am sure this will resolve your issue.
0 Likes
Highlighted
Absent Member.
Absent Member.

do you have Office 2007 installed? This might not support Loadrunner, Either move back to office 2003, or upgrade your LR version to latest 9.52 version.
0 Likes
Highlighted
Absent Member.
Absent Member.

Hi.  Thanks for suggestions here.  

 

I've got similar issue resolved, (portal logon, SSO ticket issued by Siteminder, where SAPGUI password is UNKNOWN) with some TWEAKS from the suggested solution here.

 

Here's the code:  

 

1.  Save MYSAPSSO2 cookie from SM logon.

 

//SSO cookie is huge...

web_set_max_html_param_len("4096");

 

web_reg_save_param ("MySSO",
"CONVERT=HTML_TO_TEXT",
"LB=MYSAPSSO2=",
"RB=;path",
LAST);

 

//following would be your specific logon request.

web_submit_data("signin.fcc", ...

 

2.  Using sapgui_open_connection_ex to logon to EXISTING session.  NOT create a new session.

 

// Note, SRMQA = logon group for EQU SID.  In general, replace "/M/tlsrv027.swna.wdpr.disney.com/S/3600/G/SRMQA" with whatever Vugen captured for original "sapgui_open_connection_ex" command.

// FYI, in the example post, there were extra double quotes and an extra -WP.  I've removed those to get my solution to work.  

// SID = EQU

// Client = 400

// Tcode to execute = ZPTP_ADDR_USER

sapgui_open_connection_ex("/SHORTCUT=\" -gui=/M/tlsrv027.swna.wdpr.disney.com/S/3600/G/SRMQA -sid=EQU -clt=400 -cmd=\"ZPTP_ADDR_USER\" -t=Transaction -wp=true -l=EN -reuse=0 -at=\"MYSAPSSO2={MySSO}","","con[0]");

 

// Select the active window, within the session, within the connection...

sapgui_select_active_connection("con[0]");

sapgui_select_active_session("ses[0]");

sapgui_select_active_window("wnd[0]");

 

//follow above with all the relevant SAPGUI commands.

sapgui_press_button("Create"

0 Likes
Highlighted
Absent Member.
Absent Member.

Hi ,

Thanks for the solution it's worked for me.

0 Likes
Highlighted
Absent Member.
Absent Member.

As I said earlier the solution  provided  is working  perfectly while replaying from the Vugen .But fails to invoke the SAP GUI  while executing/running  in the controller.LG hosted in Windows 2008 server and SAP GUI Client is insatalled in it

 

Receiving time-out error after waiting so much time on the sapgui_open_connection_ex() request

 

I don't know the reason for this unexpected behaviour any help is appreciated.

 

 

 

 

Thanks,

Gobianandh S

 

 

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.