0

Hopefully this is a simple one :) I am new to VuGen and trying to figure out the following...

I understand that to log in as a specic user you use the following command.

web_set_user();

For each action within my script I would like to use a different user. For some reason, although I am not getting any errors, when the second action runs the user does not change. What am I missing here ?

Note: at the end of each action I am using the following code:

web_browser("Close", "Snapshot=t001.inf", DESCRIPTION, ACTION, "UserAction=Close", LAST);

Thanks

David
  • 58
  • 1
  • 6

3 Answers3

1
  • By Looking at web_browser function in your script, I am suspecting you are using web (click and script) protocol, Click and Script is a legacy technology in LR, you can use either web (HTTP/HTML) or TruClient and leave the click and script possibilities.
  • Submitting Form by one user and Approving it by another user – Merging those two scripts into a single script is not a best practice, both are two different business flows, in general load testing SLA’ s will differ for those two flows.
  • In your case one of the possible solution is prior to the load tests, create test data using one script and seed them in another script. For more info refer this : how to pass one script variable values to another script in loadrunner
Community
  • 1
  • 1
sivaramaraju
  • 352
  • 2
  • 8
0

We need greater context. Are you attempting to mix two business processes into one piece of test code (script) because you need to pass data between them and you need to sign on with a new user for access to the second business process? Or, something else.

Keep in mind that unless your session is destroyed when you move from one action to the next, you are going to be using an already extant set of security credentials for your connection to the host. That negotiation on the new credential set needs to take place on a new connection to the server, not just a switchoff for an existing connection

James Pulley
  • 5,606
  • 1
  • 14
  • 14
  • So the context here is that I have a form which is submitted by one user then approved by another. Hence I require the 2 seperate sign-ins. Is there no simple way of doing this ? The submitted request does get a unique reference but if I went down the route of using seperate test scripts how would I pass this value from one script to the other – David Jun 16 '16 at 08:18
  • Virtual Table Server is the broker to pass information from one script to another in a LoadRunner context. If you do not wish to go the Virtual Table Server route then you can leverage RabbitMQ, Amazon Simple Queue Services, Solutions built on tope of MySQL, a queue table in a traditional SQL database (not a part of the application under test). The architecture of this is thus: User A pushes the data on the queue at the completion of task X. User B pops the value off the queue to complete process Y. Multiples of A and B can work concurrently to fill and process the queue. – James Pulley Jun 16 '16 at 12:45
0

Is there log out functionality that you can call on your application? so the server will log out of user1 at the end of one action, then log in with another user at the start of the next action.

You could look at putting the below functions at the end of the script aswell, but I'd prefer to log out from the server side.

  • Utils.cleanupAutoHeaders ()
  • Utils.clearCookies()
  • Utils.clearCache()
Brian Folan
  • 205
  • 2
  • 9