Highlighted
Absent Member.
Absent Member.
7301 views

Run script with 100 Vusers with 100 login user different

Hi Guys

 

How I can run 100 Vusers each of them with different login user?

 

Example:
vuser1 --> user1
vuser2--> user2
...
VuserN --> userN

 

 

I appreciate your help

0 Likes
12 Replies
Highlighted
Honored Contributor.
Honored Contributor.

Re: Run script with 100 Vusers with 100 login user different

Hi Jon1,

 

Put all your login users in a parameterfile.

(To enter the parameter file settings in VUGen press CTRL+L or via the menu Design -> Parameters -> Parameters List...)

 

Now look at the right bottom side of the "Parameter List"-window.

Look at the option "Select next row:".

There are 3 options Sequential, Random, Unique, select Unique here.

 

When you choose Unique you have to take care of your testdata.

You have to decide how the script should handle when you run out of testdata.

So alter a value for the option "When out of values".

Because you use logins I think you can set this to "Continu with last value".

 

Depending on the number of VU in your test you have to provide enough testdata.

You can influence this with "Allocate Vuser values in the Controller".

You can set this to Automatically or provide the number of testdata (e.g. login users) per VU.

 

If you have altered the desired testdata and settings you van simulate the testdata handling with the button "Simulate Parameter..."

Check here if every VU retrieves a Unique login.

 

I Hope this helps you in the right direction 🙂

 

 

 

NB: If this solves your problem / helps you on the way, consider acknowledging with Kudos. To kudo a post, select the thumbs up icon in the gray square by the post in the thread.
Highlighted
Absent Member.
Absent Member.

Re: Run script with 100 Vusers with 100 login user different

Hi Dennis,

 

Thank you for your answer.. your solution works in the simulate parameter!! 

 

I use function web_set_user to set the user and password   (via parameter list) in the action section.. this is correct?

 

any other way to do this?

 

I appreciate your help

 

0 Likes
Highlighted
Established Member..
Established Member..

Re: Run script with 100 Vusers with 100 login user different

For your second question, I would parameterize it. Go to the section of code where it sets the user ID & Password and add parameters for each (UN & Pass) and select the sequential, unique option and it will take the vuser, and assign him the first, second .... last respectively.

0 Likes
Highlighted
Honored Contributor.
Honored Contributor.

Re: Run script with 100 Vusers with 100 login user different

Hi Jon,

 

 

Suppose your parameter file lookes like this:

 

UN,Pass
User1,Pass1
User2,Pass2
User3,Pass3
User4,Pass4

 

And you created two parameters:

prmUsername

prmPassword

using the above parameter file.

 

And the following settings in the parameter list window:

prmUsername, Select Column: By name: UN, Select Next row: unique

prmPassword, Select Column: By name: Pass, Select Next row: same line as prmUsername 

 

your web_set_user would look something like this:

web_set_user ("{prmUsername}", "{prmPassword}", "<your webserver>:<your port>")

 

First question answered 😉

 

Second question: Any other way?

I think this is the only way to do it with web_set_user.

 

Sometimes the user credentials are send to the server with the web_submit_data function.

Then it works the same with parameterisation:

 

Example:

web_submit_data("ActionName",
        "Action=http://{prmServerURL}/Account/LoginStep1",
        "Method=POST",
        "TargetFrame=",
        "RecContentType=text/html",
        "Referer=http://{prmServerURL}/Account/LoginStep",
        "Snapshot=t2.inf",
        "Mode=HTML",
        ITEMDATA,
        "Name=UserName", "Value={prmUsername}", ENDITEM,
        "Name=Password", "Value={prmPassword}", ENDITEM,
        LAST);

 

 

With kind regards,

 

NB: If this solves your problem / helps you on the way, consider acknowledging with Kudos. To kudo a post, select the thumbs up icon in the gray square by the post in the thread.
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Run script with 100 Vusers with 100 login user different

Hi Guys thank for your answer, 

 

I test your options in Vugen and works fine but when I test in the Controller never works with more one user: the error says "session not found" or error of correlation.. and the test failed

 

the script In the vugen the script replay fine. but in the controler with many users failed

 

any idea why happen this?

0 Likes
Highlighted
Honored Contributor.
Honored Contributor.

Re: Run script with 100 Vusers with 100 login user different

Yup, we know 🙂

 

But we go off-topic now.

 

The webserver has to know where to send the information for that specific logged in user.

So the webserver assigns a unique tag to each user session.

The logged in user never sees this unique tag.

But the webserver knows who the logged in user is, by that tag.

 

One of these methods is a session id which could look like this: 765487cf34ert8dede5a562e4f3a7e12

You as a Loadrunner user has to parameterize this.

The session id is assigned after your login action in the GUI.

So in the response of the login action, you can find the session id.

Get the session id out of the response and send it with the next request to the server.

 

To get the session id make use of WEB_REG_SAVE_PARAM_EX see the online function for more information reference: http://lrhelp.saas.hp.com/en/latest/help/function_reference/FuncRef.htm

 

Specific WEB_REG_SAVE_PARAM_EX http://lrhelp.saas.hp.com/en/latest/help/function_reference/Content/web/lrFr_web_reg_save_param_ex.htm

 

Example: http://claudihome.com/html/LR/function_reference/Content/web/etc/lrFr_web_reg_save_param_ex_Example.htm

 

 

Edit: typo's.

Edit 2: Added example.

NB: If this solves your problem / helps you on the way, consider acknowledging with Kudos. To kudo a post, select the thumbs up icon in the gray square by the post in the thread.
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Run script with 100 Vusers with 100 login user different

HI Dennis

 

I know go off topic now, but really appreciate you help 

 

the WEB_REG_SAVE_PARAM_EX function is additional to the correlation parameters? ...because I correlate the session ID in my script.

 

if so when and where use WEB_REG_SAVE_PARAM_EX function? Im sorry for the many questions. I am new in the tool. (By the way  I use v12.5 and record script with SAP WEB Protocol)

 

Thank again for your answer

 

 

0 Likes
Highlighted
Honored Contributor.
Honored Contributor.

Re: Run script with 100 Vusers with 100 login user different

Hi Jon,

 

I typed the reply and later on  I was also thinking about the Design Studio (in VUGen) and auto correlation.

But, you already did that.

 

Wel I am not familar with the SAP WEB Protocol.

Would it be possible to upload the script and logging or parts of it?

Take care of classified information like URL's and other stuff.

 

Or send it by a Private message to me? 

 

No guarantee I can fix it but I will have look at it.

 

 

NB: If this solves your problem / helps you on the way, consider acknowledging with Kudos. To kudo a post, select the thumbs up icon in the gray square by the post in the thread.
0 Likes
Highlighted
Honored Contributor.
Honored Contributor.

Re: Run script with 100 Vusers with 100 login user different

Hi Jon,

 

I have been looking at your script.

 

I have some doubts about:

- the URL in web_url("default.htm",

- web_url("messagebundle_en.properties",

 

But I guess your script fails at this point web_custom_request("uif_callback_2",

Right?

If not, then it will, later on 😉

 

If yes, then you must also parametrize esid in this statement.

You can find the value of esid in the response of web_submit_data("uif_callback", it is right above  web_custom_request("uif_callback_2",

Look at the item-data in this statement, it says "Name=cmd", "Value=get_esid", ENDITEM,

 

First let us get some logging:

Edit you loglevel in VUGen: RunTime Settings (in VUGen button F4 or menu Replay -> Runtime settings), under General -> Log enter the following settings  select: Enable logging; Send messages: Always; Detail Level: Extended; Select: Parameter substitution and Data returned by server

 

Now replay you script.

 

In VUgen Output window, right bottomside, tab Output, select Replay, then you should see the logging.

I guess it fails @ web_submit_data("default.htm_2",

(If not IOU a beer 😉 )

 

Solution:

You have to do some manual correlation.  Old skool 🙂

The "Design Studio" is a great thing, but not perfect. (You can make it beter with your own correlation rules.)

 

Put a WEB_REG_SAVE_PARAM_EX right in front of web_submit_data("uif_callback",  with the right "left boundary" and "right boundary" and other things.

I have no LOG output so I can not help you out at this moment.

 

Please provide your output to me by PM.

 

 

Edit: Added a IOU 🙂

Edit 2: Typo

 

NB: If this solves your problem / helps you on the way, consider acknowledging with Kudos. To kudo a post, select the thumbs up icon in the gray square by the post in the thread.
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Run script with 100 Vusers with 100 login user different

Hi Deninis,

 

I apologize for my answer late, but I try your indications without sucess.

My Script run in VUgen and dont fails, but when i run in the controller with many users then fails

 

When you says : " then you must also parametrize esid in this statement"
where I need correlate in web_submit_data("uif_callback or web_custom_request("uif_callback_2 ??

 

You can give me an example?

 

I atached (partial) output log  and (partial)action.c:

 

Action.c

web_submit_data("uif_callback",
"Action=http://xxxx/sap/webcuif/uif_callback?sap-client=110&sap-language=EN&sap-domainRelax=min&crm_handler=CL_CRM_UI_SESSION_MANAGER",
"Method=POST",
"RecContentType=text/plain",
"Referer=http://xxxx/sap(bD1lcyZjPTEwMCZkPW1pbg==)/bc/bsp/sap/crm_ui_start/default.htm?sap-client=110&sap-language=EN",
"Snapshot=t57.inf",
"Mode=HTTP",
ITEMDATA,
"Name=cmd", "Value=get_esid", ENDITEM,
LAST);

 

web_custom_request("uif_callback_2",
"URL=http://xxxxsap/webcuif/uif_callback?sap-client=110&sap-language=EN&sap-domainRelax=min&crm_handler=CL_CRM_UI_SESSION_MANAGER",
"Method=POST",
"Resource=0",
"RecContentType=text/plain",
"Referer=http://xxxx/sap(bD1lcyZjPTEwMCZkPW1pbg==)/bc/bsp/sap/crm_ui_start/default.htm?sap-client=110&sap-language=EN",
"Snapshot=t58.inf",
"Mode=HTTP",
"EncType=application/x-www-form-urlencoded; charset=UTF-8",
"Body=cmd=store_request&esid=(ZT1RMUpFWDBGSFZGODBYMTlmTWpRek1USXdTblZnWnNBWkh0V2N2VFZlZnhVYXhBPT0=)&sap-client=110&sap-language=EN",
LAST);

 

lr_end_transaction("1_Login",LR_AUTO);

lr_start_transaction("2_Select role");

 

web_url("main.htm",

"URL=http://xxxxx/sap(ZT1RMUpFWDBGSFZGODBYMTlmTWpRek1USXdTblZnWnNBWkh0V2N2VFZlZnhVYXhBPT0=)/bc/bsp/sap/crm_ui_frame/main.htm?sap-client=110&sap-language=EN&sap-domainRelax=min&saprole=ZSG_UTIL_IC",
"Resource=0",
"RecContentType=text/html",
"Referer=http://xxxxx/sap(bD1lcyZjPTEwMCZkPW1pbg==)/bc/bsp/sap/crm_ui_start/default.htm?sap-client=110&sap-language=EN",
"Snapshot=t59.inf",
"Mode=HTTP",
LAST);

 

Output Log: 

 

Action.c(82): web_submit_data("uif_callback") started [MsgId: MMSG-26355]
Action.c(82): t=2240ms: 104-byte response headers for "http://xxxx/sap/webcuif/uif_callback?sap-client=110&sap-language=EN&sap-domainRelax=min&crm_handler=CL_CRM_UI_SESSION_MANAGER" (RelFrameId=1, Internal ID=7)
Action.c(82): HTTP/1.1 200 OK\r\n
Action.c(82): content-type: text/plain; charset=utf-8\r\n
Action.c(82): content-length: 70\r\n
Action.c(82): x-sap-servertime: 455 \r\n
Action.c(82): \r\n
Action.c(82): t=2245ms: 70-byte response body for "http://xxxx/sap/webcuif/uif_callback?sap-client=110&sap-language=EN&sap-domainRelax=min&crm_handler=CL_CRM_UI_SESSION_MANAGER" (RelFrameId=1, Internal ID=7)
Action.c(82): (ZT1RMUpFWDBGSFZGOHhYMTlmTWpRek1UTXhTblZnWnNBWkh0V2MyQjd1Q0l6SVF3PT0=)
Action.c(82): web_submit_data("uif_callback") was successful, 70 body bytes, 104 header bytes [MsgId: MMSG-26386]

 

Action.c(93): web_custom_request("uif_callback_2") started [MsgId: MMSG-26355]
Action.c(93): t=2314ms: 89-byte response headers for "http://xxxx/sap/webcuif/uif_callback?sap-client=110&sap-language=EN&sap-domainRelax=min&crm_handler=CL_CRM_UI_SESSION_MANAGER" (RelFrameId=1, Internal ID=8)
Action.c(93): HTTP/1.1 200 OK\r\n
Action.c(93): content-type: text/plain\r\n
Action.c(93): content-length: 0\r\n
Action.c(93): x-sap-servertime: 2337 \r\n
Action.c(93): \r\n
Action.c(93): web_custom_request("uif_callback_2") was successful, 0 body bytes, 89 header bytes [MsgId: MMSG-26386]
Action.c(105): Notify: Transaction "1_Login" ended with a "Pass" status (Duration: 0,7734 Wasted Time: 0,0947).
Action.c(107): Notify: Transaction "2_Select role" started.
Action.c(109): web_url("main.htm") started [MsgId: MMSG-26355]
Action.c(109): t=2428ms: 573-byte response headers for "http://xxxx/sap(ZT1RMUpFWDBGSFZGODBYMTlmTWpRek1USXdTblZnWnNBWkh0V2N2VFZlZnhVYXhBPT0=)/bc/bsp/sap/crm_ui_frame/main.htm?sap-client=110&sap-language=EN&sap-domainRelax=min&saprole=ZSG_UTIL_IC" (RelFrameId=1, Internal ID=9)
Action.c(109): HTTP/1.1 302 Moved temporarily\r\n
Action.c(109): set-cookie: sap-hostid=xxx_CRD_12; path=/sap(ZT1RMUpFWDBGSFZGODBYMTlmTWpRek1USXd
Action.c(109): TblZnWnNBWkh0V2N2VFZlZnhVYXhBPT0=)/bc/bsp/sap/crm_ui_frame/\r\n
Action.c(109): content-type: text/html; charset=utf-8\r\n
Action.c(109): content-encoding: gzip\r\n
Action.c(109): content-length: 1413\r\n
Action.c(109): location: /sap(bD1FTiZjPTExMCZpPTEmZT1RMUpFWDBGSFZGODBYMTlmTWpRek1USXdTblZnWnNBWkh0V2N2VFZ
Action.c(109): lZnhVYXhBJTNkJTNk)/bc/bsp/sap/crmcmp_ic_frame/start.htm?sap-client=110&sap-domainrelax=min
Action.c(109): &sap-language=EN&saprole=ZSG_UTIL_IC\r\n
Action.c(109): expires: 0\r\n
Action.c(109): pragma: no-cache\r\n
Action.c(109): cache-control: no-store\r\n
Action.c(109): connection: Keep-Alive\r\n
Action.c(109): \r\n
Action.c(109): t=2435ms: 1413-byte ENCODED response body received for "http://xxxxx/sap(ZT1RMUpFWDBGSFZGODBYMTlmTWpRek1USXdTblZnWnNBWkh0V2N2VFZlZnhVYXhBPT0=)/bc/bsp/sap/crm_ui_frame/main.htm?sap-client=110&sap-language=EN&sap-domainRelax=min&saprole=ZSG_UTIL_IC" (RelFrameId=1, Internal ID=9)
Action.c(109): t=2437ms: 4441-byte DECODED response body for "http://xxxxx/sap(ZT1RMUpFWDBGSFZGODBYMTlmTWpRek1USXdTblZnWnNBWkh0V2N2VFZlZnhVYXhBPT0=)/bc/bsp/sap/crm_ui_frame/main.htm?sap-client=110&sap-language=EN&sap-domainRelax=min&saprole=ZSG_UTIL_IC" (RelFrameId=1, Internal ID=9)
Action.c(109): \r\n
Action.c(109): <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"\r\n
Action.c(109): "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">\r\n
Action.c(109): \r\n
Action.c(109): <html>\r\n
Action.c(109): <head>\r\n
Action.c(109): <title></title>\r\n
Action.c(109): <script type="text/javascript" src="/sap(====)/bc/bsp/sap/ic_base/scripts/common/ic_base_u
Action.c(109): tils_map.js"></script>\r\n
Action.c(109): <script type="text/javascript" src="/sap(====)/bc/bsp/sap/uicmp_ltx/LaunchTransactionAdmin
Action.c(109): .js"></script>\r\n
Action.c(109): <script type="text/Javascript" src="/sap(====)/bc/bsp/sap/crm_ui_frame/crm_ui_frame_async_
Action.c(109): sender.js"></script>\r\n
Action.c(109): \r\n
Action.c(109): \r\n
Action.c(109): <script type="text/javascript" src="/sap(====)/bc/bsp/sap/crm_ui_frame/asynchronApplWindow
Action.c(109): Access.js"></script>\r\n
Action.c(109): \r\n
Action.c(109): \r\n
Action.c(109): <script type="text/javascript">\r\n
Action.c(109): \r\n
Action.c(109): var WorkAreaFrame2_active = false;\r\n
Action.c(109): var currentDisplayedFrame = "";\r\n
Action.c(109): var emptyTarget = "blank.htm";\r\n
Action.c(109): \r\n
Action.c(109): {var liBehindFirstDot = location.hostname.indexOf(".")+1;if (liBehindFirstDot > 0)document
Action.c(109): .domain = location.hostname.substr(liBehindFirstDot);}\r\n
Action.c(109): window.top.gv_profile_type = "B";\r\n
Action.c(109): </script>\r\n
Action.c(109): <script type="text/javascript" src="/sap(====)/bc/bsp/sap/crm_ui_start/crmuifClient.js"></
Action.c(109): script>\r\n
Action.c(109): <script type="text/javascript">\r\n
Action.c(109): \r\n
Action.c(109): if(window.parent.updateSessionID) window.parent.updateSessionID( "SID%3aANON%3axxx
Action.c(109): p2_CRD_12%3aVgvMARCdt9Lw7w8ORYVTUe-GWp506bcwj5lJxGaQ-ATT" );\r\n
Action.c(109): \r\n
Action.c(109): \r\n
Action.c(109): \r\n
Action.c(109): \r\n
Action.c(109): function frameLoaded(name){\r\n
Action.c(109): \r\n
Action.c(109): var targetToDelete = "";\r\n
Action.c(109): \r\n
Action.c(109): \r\n
Action.c(109): try{\r\n
Action.c(109): var currentFrame = document.getElementsByName(name)[0];\r\n
Action.c(109): var isFrameInitial = currentFrame.getAttribute("fsInit");\r\n
Action.c(109): if(isFrameInitial == null || isFrameInitial == "" ){\r\n
Action.c(109): currentFrame.setAttribute("fsInit", "loaded");\r\n
Action.c(109): \r\n
Action.c(109): if(name == "WorkAreaFrame2"){\r\n
Action.c(109):

...

 

I Appreciate your help!!

 

 

0 Likes
Highlighted
Honored Contributor.
Honored Contributor.

Re: Run script with 100 Vusers with 100 login user different

Hi Jon,

 

Wow, this is gonna be hard. Let's have a try:

 

This is the response from "uif_callback":


Action.c(82): web_submit_data("uif_callback") started [MsgId: MMSG-26355]
Action.c(82): t=2240ms: 104-byte response headers for "http://xxxx/sap/webcuif/uif_callback?sap-client=110&sap-language=EN&sap-domainRelax=min&crm_handler=CL_CRM_UI_SESSION_MANAGER" (RelFrameId=1, Internal ID=7)
Action.c(82): HTTP/1.1 200 OK\r\n
Action.c(82): content-type: text/plain; charset=utf-8\r\n
Action.c(82): content-length: 70\r\n
Action.c(82): x-sap-servertime: 455 \r\n
Action.c(82): \r\n
Action.c(82): t=2245ms: 70-byte response body for "http://xxxx/sap/webcuif/uif_callback?sap-client=110&sap-language=EN&sap-domainRelax=min&crm_handler=CL_CRM_UI_SESSION_MANAGER" (RelFrameId=1, Internal ID=7)
Action.c(82): (ZT1RMUpFWDBGSFZGOHhYMTlmTWpRek1UTXhTblZnWnNBWkh0V2MyQjd1Q0l6SVF3PT0=)
Action.c(82): web_submit_data("uif_callback") was successful, 70 body bytes, 104 header bytes [MsgId: MMSG-26386]

 

The response from "uif_callback" has a size of 70 bytes (because content-length: 70 and also see 70-byte response)
These 70 bytes are: (ZT1RMUpFWDBGSFZGOHhYMTlmTWpRek1UTXhTblZnWnNBWkh0V2MyQjd1Q0l6SVF3PT0=)

We have to save the string between the parentheses '()' in a variable called ESID

Therefore we have to put a web_reg_save_param_ex right after web_submit_data("default.htm_2", and before web_submit_data("uif_callback", like this:

 

web_submit_data("default.htm_2",

.

.

.

LAST);

 

web_reg_save_param_ex(
"ParamName=prmESID",
"LB/IC=(",
"RB/IC=)",
"Notfound=error",
LAST);

 

web_submit_data("uif_callback",

.

.

.

LAST);

  

Help information on web_rege_save_param_ex: http://lrhelp.saas.hp.com/en/latest/help/function_reference/Content/web/lrFr_web_reg_save_param_ex.htm

 

Kind of the same but with the deprecated web_rege_save_param: http://h30499.www3.hp.com/t5/LoadRunner-Support-Forum/how-to-get-using-web-reg-save-param-to-extract-count-in-below/m-p/6309027#M7712

Next we have to do is change web_custom_request("uif_callback_2",
Replace:

 

"Body=cmd=store_request&esid=(ZT1RMUpFWDBGSFZGODBYMTlmTWpRek1USXdTblZnWnNBWkh0V2N2VFZlZnhVYXhBPT0=)&sap-client=110&sap-language=EN",

 

With:

 

"Body=cmd=store_request&esid=({prmESID})&sap-client=110&sap-language=EN",

 

Check you Runtime Settings (F4 in VuGen), if not applied yet also select log -> Detail Level -> Extended -> Check Parameter substitution.

Re-run your script.

 

I am curious about the output.txt. 🙂

 

NB: If this solves your problem / helps you on the way, consider acknowledging with Kudos. To kudo a post, select the thumbs up icon in the gray square by the post in the thread.
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.