Highlighted
Absent Member.
Absent Member.
583 views

Assign ID for each VUser

My scenario is as follows:
I have multiple scripts, running from the Controller, each with multiple users. Each user needs to have a different ID. The ID's are pre-determined, something like test_user1 - test_user25. Currently, we have it set up so that each user will pick a unique ID from a spreadsheet. Each script has its own spreadsheet, with no user ID repeated in the different spreadsheets. This generally works fine. The problem arises when a user fails. If a user fails, usually due to an unexpected screen, we normally want to restart this user. The problem is that the user does not keep his ID, instead he would go to the next row in the datatable, which is probably blank, since we do not have extra ID's allocated for each script. If we cycle through the sheet again, we will end up having the same user logged in multiple times, which is also bad.

What I would like to do, but am doubting that it is possible, is to assign each VUser a unique #. Then, in the script, I could say append that # to the end of test_user. I thought I could do this with the Vuser ID parameter type, and assign each user a unique VUser ID from the Controller. Unfortunately, I found out that I cannot modify the VUser ID's there - my only option is to renumber, which will just number from 1 to whatever. This won't work if we are using multiple scripts.

The only other thing I can think of is to add extra ID's in the spreadsheet, which also means that we have to set up these users in the system. Any other suggestions?
0 Likes
5 Replies
Highlighted
Absent Member.
Absent Member.

Re: Assign ID for each VUser

Hi Joshua,

If i understand you correctly, you are using Unique on each iteration.

I guess you can try "Unique Once"
Refer the attachment..
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Assign ID for each VUser

I am actually already using Unique Once - the problem is if a user fails. When we restart this user, it is treated as a new user, so it chooses the next row.
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Assign ID for each VUser

try sequential each iteration

sunkara,
http://loadrunner95.blogspot.com/
0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

Re: Assign ID for each VUser

Are you able to tell when the users hit an unexpected screen? If you can catch the failures, you can restart the virtual users with code (instead of having them fail out completely).

Try keeping your login/logout code in their own action sections. you can call these actions like they are functions from anywhere within your script. That way the user can fail and re-login without losing the unique id you picked.

The only other option I see here is to use VTS (virtual table server) and keep track of the user ids that way.
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Assign ID for each VUser

"Are you able to tell when the users hit an unexpected screen? "
Sometimes, other times not until they fail - unless we put validations before every single step.

"Try keeping your login/logout code in their own action sections. you can call these actions like they are functions from anywhere within your script. That way the user can fail and re-login without losing the unique id you picked."
We already have them in their own actions. I guess 1 problem we have is that sometimes we really want the user to fail - this signifies that there is a bigger issue than the normal errors that they may be able to handle. Since we cannot throw errors with specific codes, failing is the only way to 'handle' the error during the scenario. With all the error messages (which are sometimes quite valid, i.e. another user is attempting to pick the same order), we cannot sift through the 100's or 1000's of error messages we get until after the scenario is finished.

"The only other option I see here is to use VTS (virtual table server) and keep track of the user ids that way."
That seems like a legitimate option - we looked at VTS a little for a different reason earlier, but never ended up trying it. If we can figure out how to get that working, then that would probably do what we want here. I figure we could put in the vuser_end function a command to put the id back on the VTS, right?
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.