Highlighted
Regular Contributor.. Regular Contributor..
Regular Contributor..
2123 views

Loadrunner 11.52 and SAP BI, bttoken capture problems

Hi

 

I am trying to test a SAP BI application.  When I record, I see that it receives a token called bttoken during the login process. This is then used in calls after login. When I let LR correlate this, it creates this code

 

web_reg_save_param_regexp(
"ParamName=CorrelationParameter",
"RegExp=bttoken=(.*?)\";\\\n</script",
SEARCH_FILTERS,
"Scope=all",
"IgnoreRedirections=No",
LAST);

web_submit_data("logon.faces_2",
"Action=http://server:port/BOE/portal/number/InfoView/logon.faces",
"Method=POST",
"TargetFrame=servletBridgeIframe",
"RecContentType=text/html",
"Referer=http://server:port/BOE/portal/number/InfoView/logon.faces",
"Snapshot=t3.inf",
"Mode=HTML",
ITEMDATA,
"Name=_id0:logon:CMS", "Value={strEnvironment}", ENDITEM,
"Name=_id0:logon:USERNAME", "Value={strUser}", ENDITEM,
"Name=_id0:logon:PASSWORD", "Value={strPassword}", ENDITEM,
"Name=com.sun.faces.VIEW", "Value=_id147:_id148", ENDITEM,
"Name=_id0", "Value=_id0", ENDITEM,
LAST);

 

Note, that

{strEnvironment} = server:port.

 

WWhen I rerun this, the value for bttoken is not found. If I try to catch it with a web_reg_save_param_ex construction, it is also not found. Who has experience with this problem and can set me on the right way? It looks like the bttoken is somehow not returned, maybe the value in

"Name=com.sun.faces.VIEW", "Value=_id147:_id148", ENDITEM, 

 

is wrong, cause this is different in every recording, but I do not know the mechhanism beind this.

0 Likes
6 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

Could you share the code generation log?
0 Likes
Highlighted
Regular Contributor.. Regular Contributor..
Regular Contributor..

Sharing the whole log is a bit sensitive. Maybe this will already work:

 

There are two web_submit_data statements in my script: 

 

web_submit_data("logon.faces", 
        "Action=http://servername:portnumber/BOE/portal/1406211114/InfoView/logon.faces", 
        "Method=POST", 
        "TargetFrame=servletBridgeIframe", 
        "RecContentType=text/html", 
        "Referer=http://servername:portnumber/BOE/BI", 
        "Snapshot=t2.inf", 
        "Mode=HTML", 
        ITEMDATA
        EXTRARES
        "Url=../BIPCoreWeb/images/center_normal_logon.gif", ENDITEM
        "Url=css/skin/input.gif", ENDITEM
        "Url=common/appService.do?service=skinning&resource=img&img=img.login.banner.logo", ENDITEM
        LAST);

 

Loadrunner wants to correlate before this step:

 

     web_reg_save_param_regexp(
        "ParamName=CorrelationParameter",
        "RegExp=bttoken=(.*?)\";\\\n</script",
        SEARCH_FILTERS,
        "Scope=all",
        "IgnoreRedirections=No",
        LAST);

 

web_submit_data("logon.faces_2", 
        "Action=http://servername:portnumber/BOE/portal/1406211114/InfoView/logon.faces", 
        "Method=POST", 
        "TargetFrame=servletBridgeIframe", 
        "RecContentType=text/html", 
        "Referer=http://servername:portnumber/BOE/portal/1406211114/InfoView/logon.faces", 
        "Snapshot=t3.inf", 
        "Mode=HTML", 
        ITEMDATA
        "Name=_id0:logon:CMS", "Value={strEnvironment}", ENDITEM
        "Name=_id0:logon:USERNAME", "Value={strUser}", ENDITEM
        "Name=_id0:logon:PASSWORD", "Value={strPassword}", ENDITEM
        "Name=com.sun.faces.VIEW", "Value=_id147:_id148", ENDITEM
        "Name=_id0", "Value=_id0", ENDITEM
        LAST);

 

BUT: if I look in the generation log, the first transaction (id 697)seems to be setting cookies already, that contain the username credentials!

****** Response Header For Transaction With Id 697 ******

HTTP/1.1 200 OK

Server: Apache-Coyote/1.1

X-UA-Compatible: IE=edge,requiresActiveX=true

Set-Cookie: InfoViewPLATFORMSVC_COOKIE_TOKEN=; Path=/; HttpOnly

Set-Cookie: InfoViewPLATFORMSVC_COOKIE_CMS=******%3A6400; Path=/; HttpOnly; Expires=Thu, 16-Jul-15 15:15:56 GMT

Set-Cookie: InfoViewPLATFORMSVC_COOKIE_USR=UserName; Path=/; HttpOnly; Expires=Thu, 16-Jul-15 15:15:56 GMT

Set-Cookie: InfoViewPLATFORMSVC_COOKIE_AUTH=secLDAP; Path=/; HttpOnly; Expires=Thu, 16-Jul-15 15:15:56 GMT

 

I tried moving the correlationstep through the script, but sofar no result with that.

0 Likes
Highlighted
Outstanding Contributor.. Outstanding Contributor..
Outstanding Contributor..

Hi,

 

Please check on Code generation log, if the value doesnt display on Response item which means your value is generate from client side. LR correlation is the capturing of the dynamic values when it's returned by server. If it's from client side so LR can not correlate it.

 

Regards,

Chau

Regards,

Chau Nguyen | SW Technical Support Consultant.
LoadRunner and Performance Center


If you find that this or any other post resolves your issue, please be sure to mark it as an accepted solution.
If you are satisfied with anyone’s response please remember to give them a KUDOS by clicking on the STAR at the bottom left of the post and show your appreciation.
0 Likes
Highlighted
Regular Contributor.. Regular Contributor..
Regular Contributor..

Hi

 

I'm sorry, forgot to post the resonses. I see this in the generation log:

TransactionId 369 is the 

POST /BOE/portal/1406211114/InfoView/logon.faces 

call I posted before.  As far as I see, the value is coming from server side, or am I mistaken here?

 

****** Request Body For Transaction With Id 369 ******
_id0%3Alogon%3ACMS=sasapas7235%3A6400&_id0%3Alogon%3AUSERNAME=******&_id0%3Alogon%3APASSWORD=********&com.sun.faces.VIEW=_id39%3A_id40&_id0=_id0
$$$$$$ Request Body For Transaction With Id 369 Ended $$$$$$

 

****** Response Body For Transaction With Id 369 ******
<html><head><script type="text/javascript">window.location = "../InfoView/listing/main.do?service=%2Fcommon%2FappService.do&appKind=InfoView&bttoken=MDAwRGRJP0Y5OEMPLZGI3UUhnV2JiXmVfPjU3S2BcOjAEQ";</script></head></html>

0 Likes
Highlighted
Outstanding Contributor.
Outstanding Contributor.

Do you have the replay log (with server response) around the web_submit_data("logon.faces_2", step?

 

You can also try update the regular expression, like 

"RegExp=bttoken=(.*?)\";",

0 Likes
Highlighted
Frequent Visitor.

"Name=com.sun.faces.VIEW", "Value=_id147:_id148", ENDITEM,

Issue will be resolve if you do corelation for above dynamic values. _id147:_id148

Regards,

Nagaraju Thogaru

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.