Highlighted
Absent Member.
Absent Member.
657 views

LoadRunner JavaScript and parametrization question

Hi to everyone.
I have a question related to bunch of LR 9.5 + JavaScript.
The situations is following:
There is a login web page which contains username and password.When users inter user name and password and click the "enter" button, an encryption java script (md5.js) runs and sends the md5 format of password to server.I applay a parametrization for usernames and passwords, but I don't know how to apply a parametrization for the field that containes md5 format of password. I need the way to identify the result of running javascript on password and insert the result to md5_password field.
my script is following:
web_add_cookie("JSESSIONID=VKCrLGqHhbT2q0NwMBWyjShP6K62Zxpphrw1dj5Q8CgTkpfFLfsq!733620908!-1623274462; DOMAIN={ipaddress}");

web_url("Student",
"URL=http://{ipaddress}/Student/",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t24.inf",
"Mode=HTML",
EXTRARES,
"Url=login/js/md5.js", "Referer=http://{ipaddress}/Student/login/loginPage.jsp", ENDITEM,
"Url=login/js/gen_validatorv2.js", "Referer=http://{ipaddress}/Student/login/loginPage.jsp", ENDITEM,
"Url=login/images/pageback.jpg", "Referer=http://{ipaddress}/Student/login/loginPage.jsp", ENDITEM,
"Url=login/images/login-logo.gif", "Referer=http://{ipaddress}/Student/login/loginPage.jsp", ENDITEM,
LAST);

// [WCSPARAM WCSParam_Diff2 10 1298150591] Parameter {WCSParam_Diff2} created by Correlation Studio
web_reg_save_param( "WCSParam_Diff2", "LB=__rp=", "RB=\"", "Ord=1", "IgnoreRedirections=Yes", "Search=Body", "RelFrameId=1.1", LAST );
web_submit_data("login.citadel_security_check",
"Action=http://{ipaddress}/Student/login.citadel_security_check",
"Method=POST",
"RecContentType=text/html",
"Referer=http://{ipaddress}/Student/login/loginPage.jsp",
"Snapshot=t25.inf",
"Mode=HTML",
ITEMDATA,
"Name=username", "Value={username}", ENDITEM,
"Name=password", "Value={password}", ENDITEM,
"Name=md5_password", "Value=7203760258a024875eeb8131ac7203ff", ENDITEM,
"Name=B1", "Value=enter", ENDITEM,

my problem is on parametrization of "md5_password" which contains the md5 format of password field.


I'm looking forward to any interesting decision how to solve this task.

Regards
0 Likes
2 Replies
Highlighted
Absent Member.
Absent Member.

Re: LoadRunner JavaScript and parametrization question

First, you can try seeing from your generation log if the md5 format of password can be obtained from the server responses for any of the previous requests.

If you are in a situation where the md5 format is generated in the same request as that of your submit_data then you can probably try replicating the submit_data twice in the script. For the first one, comment out the line of the md5_password and have a WSRP statement on top of it to capture the md5 format password that is generated and in the second submit_data you can use the captured md5 password instead of the hard-coded one. Not sure if this will work, but you can give it a try.

Thanks
Prashanth Thimmavajjala
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: LoadRunner JavaScript and parametrization question

if the server is not creating the password, it is probably being created using javascript most probably inside gen_validatorv2.js.

If so, either recreate the same code into C and use the function or use some publicly available md5 sum generator function/ headers to generate the data required.
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.