NOTICE: Significant community changes coming soon
The header menu and the home page on our community will be changing soon. Get more information HERE.
Highlighted
Absent Member.
Absent Member.
2838 views

Iterations and System Load test

Jump to solution

Hey ppl,

I am facing a typical problem, that could be really silly.

 

I need a user to login to the application and view account summary 5 times and logout, ie, Login:1, Iteratoins:5, logout:1.

When I look into the recorded script, I see 3 partitions Tinit, Tmain and Tend, where all my user actions are captured in Tmain, including login and logout.

When I replay the script with Tmain value as 5 and when I run the script with for 5 users in workload, I see the same behavior, unmindful of whatever my workload type is, ie, there are 25 logins, 25 actions and 25 logouts. But my ultimate aim is to achieve, 5 users to login and each has to perform the action, say, view account profile, and all 5 users to logout, so that at any point in time, 5 users remain in the system, during execution.

 

In LR, there is an option where login can be recorded in ‘Init’, view account summary in ‘Action’ and logout in ‘End’. So when I do iterations, the user logs in once and does transaction 5 times and logout of the system.

 

Kindly help me in solving the issue which would be very useful.

0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Frequent Contributor
Micro Focus Frequent Contributor

hi Krish

This is a common question.  The recorder contains a new transaction button.  Start recording and as soon as the page loads (before you login) click on new transaction and call it TLogin or something like that. Now login to the app and click the new transaction button and call it TActions or something like that.  Now carry out all actions and when you are ready to logout click the new transaction button again and call it Tlogout and then logout of the app.

This will likely give you TInit, TLogin, TMain, TActions Tlogout:

 transactions

   TInit           : begin;

   TMain           : 1;

   TLogin          : 1;

   TActions        : 1;

   TLogout         : 1;

Go to the transaction declaration and change Tlogin to begin and TLogout to End.  Remove TInit and TMain from this section as they are no longer needed.  Move any Tinit code into the start of Tlogin.  if you do have a TEnd remove it.

Now set Tmain to 5.  Should look like this:

 transactions

   TLogin          : begin;

   TActions        : 5;

   TLogout         : end;

The recorder will handle any cookies that are required but bear in mind that you definitely need to clear cache and cookies before recording.

View solution in original post

0 Likes
2 Replies
Highlighted
Micro Focus Frequent Contributor
Micro Focus Frequent Contributor

hi Krish

This is a common question.  The recorder contains a new transaction button.  Start recording and as soon as the page loads (before you login) click on new transaction and call it TLogin or something like that. Now login to the app and click the new transaction button and call it TActions or something like that.  Now carry out all actions and when you are ready to logout click the new transaction button again and call it Tlogout and then logout of the app.

This will likely give you TInit, TLogin, TMain, TActions Tlogout:

 transactions

   TInit           : begin;

   TMain           : 1;

   TLogin          : 1;

   TActions        : 1;

   TLogout         : 1;

Go to the transaction declaration and change Tlogin to begin and TLogout to End.  Remove TInit and TMain from this section as they are no longer needed.  Move any Tinit code into the start of Tlogin.  if you do have a TEnd remove it.

Now set Tmain to 5.  Should look like this:

 transactions

   TLogin          : begin;

   TActions        : 5;

   TLogout         : end;

The recorder will handle any cookies that are required but bear in mind that you definitely need to clear cache and cookies before recording.

View solution in original post

0 Likes
Highlighted
Absent Member.
Absent Member.

Hi Jonny,

I have recorded a script which is in the following format.

benchmark SilkPerformerRecorder

use "WebAPI.bdh"

dcluser

 user

   VUser

 transactions

   TInit           : begin;

   TMain           : 1;

   TShutDown : end;

var

dclrand

dcltrans

transaction TInit

 begin

   WebSetBrowser(WEB_BROWSER_MSIE8);

   WebModifyHttpHeader("Accept-Language", NULL, WEB_MODIFY_OPT_Remove);

   //WebSetUserBehavior(WEB_USERBEHAVIOR_FIRST_TIME);

   //WebSetDocumentCache(true, WEB_CACHE_CHECK_SESSION);

 end TInit;

transaction TMain

 var

   hWebStoredCtx_ApplName : number;

 begin

Login (Timer starts)

WebPageStoreContext(hWebStoredCtx_ApplName)

Login (Timer ends)

Action (Timer starts)

transactions steps recorded

Action (Timer ends)

Logout (TImer starts)

WebPageDeleteContext(hWebStoredCtx_ApplName)

Logout (Timer ends)

transaction TEnd

Tshutdown

I need to run this script for 5 users where my 'Action' alone has to be iterated 2 times for all the 5 users. Kindly note that all my script line items are being stored under TMain part, so when I increase the TMain value all my transactions including Login and Logout are being iterated. I need only the action to be iterated, but the session must be kept alive such that all my users log in and performs the action 2 times and then logs out. I use the following param setup:

• sequential test wide and per test option to the login parameter, since it is a single sign-on application

• sequential test wide and per transaction option to my other test data that can be reused

I tried cutting the login transaction part and paste it in TInit and logout in Tend, I get an error pointing to the WebPageStoreContext line.

Kindly help me achieve my requirement. I am also not sure whether I have provided enough input for the issue am facing.

Krish

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.