Highlighted
Absent Member.
Absent Member.
376 views

Replace parameter

When i Record the script >enter William in search and click on the search button > 5 william value are came. again i go back and search with 1 william mail id and log out from application.

When i run the script and change the value from WILLIAM to NANCY and when i ran the script with change name it is not showing any error message how can i replace the mail id with Nancy.......??????
0 Likes
4 Replies
Highlighted
Absent Member.
Absent Member.

Re: Replace parameter

Taresh, where are you changing the value from WILLIAM to NANCY. Are you changing it in the script? What error are you expecting?
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Replace parameter

Parametrize where you changing the name (in search), then correlate the search result to capture the 1st mail id.

Let me know if this works fine with you.

Jyoti Prakash
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Replace parameter


Hi I print the script.
Suppose i replace the Search value from "William " to "Nancy" in Another Search script("Name=search_keyword", "Value=WSMITH@company.com", ENDITEM,
"Name=sid", "Value={WCSParam_Diff1}", ENDITEM,
LAST);
Second search value is with mail id of William:WSMITH@company.com..

Then how can i replace this mail id with Nancy mail id....Means every time when i can change the First value it will automatically pick the mail id with first search name............



Action()
{

web_add_auto_header("Accept",
"*/*");

web_add_auto_header("Accept-Encoding",
"gzip, deflate");

web_add_auto_header("Accept-Language",
"en-us");

web_add_auto_header("User-Agent",
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648)");


web_url("WebApp1",
"URL=http://172.30.147.12:8080/WebApp1",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
LAST);
web_url("login_backgnd4.JPG",
"URL=http://172.30.147.12:8080/WebApp1/login_backgnd4.JPG",
"TargetFrame=",
"Resource=1",
"RecContentType=image/jpeg",
"Referer=http://172.30.147.12:8080/WebApp1/",
"Snapshot=t2.inf",
LAST);

web_add_auto_header("Accept",
"image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/msword, application/xaml+xml, application/vnd.ms-xpsdocument, application/x-ms-xbap, application/x-ms-application, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, */*");

web_add_auto_header("Cache-Control",
"no-cache");

// [WCSPARAM WCSParam_Diff1 28 4c9d5871dae4c8bc7c1740ca6a68] Parameter {WCSParam_Diff1} created by Correlation Studio
web_reg_save_param("WCSParam_Diff1",
"LB= value='",
"RB='",
"Ord=1",
"RelFrameId=1",
"Search=Body",
"IgnoreRedirections=Yes",
LAST);
web_submit_data("Session.jsp",
"Action=http://172.30.147.12:8080/WebApp1/Session.jsp",
"Method=POST",
"TargetFrame=",
"RecContentType=text/html",
"Referer=http://172.30.147.12:8080/WebApp1/",
"Snapshot=t3.inf",
"Mode=HTML",
ITEMDATA,
"Name=username", "Value=Steven", ENDITEM,
"Name=password", "Value=King", ENDITEM,
LAST);

// [WCSPARAM WCSParam_Diff2 11 My_Page.jsp] Parameter {WCSParam_Diff2} created by Correlation Studio
web_reg_save_param("WCSParam_Diff2",
"LB=form action=\"",
"RB=\"",
"Ord=1",
"RelFrameId=1",
"Search=Body",
"IgnoreRedirections=Yes",
LAST);
web_submit_data("Search.jsp",
"Action=http://172.30.147.12:8080/WebApp1/Search.jsp",
"Method=POST",
"TargetFrame=",
"RecContentType=text/html",
"Referer=http://172.30.147.12:8080/WebApp1/My_Page.jsp?user1=Steven&session_id={WCSParam_Diff1}",
"Snapshot=t4.inf",
"Mode=HTML",
ITEMDATA,
"Name=search_keyword", "Value=William", ENDITEM,
"Name=sid", "Value={WCSParam_Diff1}", ENDITEM,
LAST);

web_submit_data("{WCSParam_Diff2}",
"Action=http://172.30.147.12:8080/WebApp1/{WCSParam_Diff2}",
"Method=POST",
"TargetFrame=",
"RecContentType=text/html",
"Referer=http://172.30.147.12:8080/WebApp1/Search.jsp",
"Snapshot=t5.inf",
"Mode=HTML",
ITEMDATA,
LAST);

web_submit_data("Search.jsp_2",
"Action=http://172.30.147.12:8080/WebApp1/Search.jsp",
"Method=POST",
"TargetFrame=",
"RecContentType=text/html",
"Referer=http://172.30.147.12:8080/WebApp1/{WCSParam_Diff2}",
"Snapshot=t6.inf",
"Mode=HTML",
ITEMDATA,
"Name=search_keyword", "Value=WSMITH@company.com", ENDITEM,
"Name=sid", "Value={WCSParam_Diff1}", ENDITEM,
LAST);

web_revert_auto_header("Cache-Control");

web_url("Logout",
"URL=http://172.30.147.12:8080/WebApp1/Logout.jsp?",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=http://172.30.147.12:8080/WebApp1/Search.jsp",
"Snapshot=t7.inf",
"Mode=HTML",
LAST);

return 0;
}

0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Replace parameter

Correlation looks to be the solution to your problem. Correlate the value "WSMITH@company.com". For more information on correlation, refere the following link: http://motevich.blogspot.com/2007/10/loadrunner-scripts-correlation-tutorial.html
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.