Highlighted
Absent Member.
Absent Member.
4241 views

Users and Iterations in SilkPerformer

Jump to solution

Hey ppl,

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

 

When I try 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.

 

Experts…Help me out….

 

Krish

0 Likes
1 Solution

Accepted Solutions
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Users and Iterations in SilkPerformer

Jump to solution

* WebPageStoreContext needs a variable. If you move the function to another transaction, make sure that the variable is declared globally in the 'var' section. If thats not the cause, please post the exact compiler or runtime error message.

* instead of moving the stuff into transactions, cannot you simply try put a loop around the action?

for i := 1 to 2 do
  Action (Timer starts)
  transactions steps recorded
  Action (Timer ends)
end;

View solution in original post

0 Likes
5 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Users and Iterations in SilkPerformer

Jump to solution

* WebPageStoreContext needs a variable. If you move the function to another transaction, make sure that the variable is declared globally in the 'var' section. If thats not the cause, please post the exact compiler or runtime error message.

* instead of moving the stuff into transactions, cannot you simply try put a loop around the action?

for i := 1 to 2 do
  Action (Timer starts)
  transactions steps recorded
  Action (Timer ends)
end;

View solution in original post

0 Likes
Highlighted
Absent Member.
Absent Member.

RE: Users and Iterations in SilkPerformer

Jump to solution

Dear Johannes,

Please find below the scenarios which I followed.

Scenario 1:

Global Declaration of PageContext var

TInit – Login

TMain

  Action (Timer starts)

  Transactions steps recorded (including Close the pop-up Window action)

  Action (Timer ends)

end TMain;

TShutdown – Logout action

Scenario 2:

TMain

Declare context var and I

Login action

I := 0;

loop

if I >= 3 then exit end;

  I := I+1;

  Action (Timer starts)

  Transactions steps recorded (including Closing the pop-up Window action)

  Action (Timer ends)

end;

Logout action

end TMain;

Iteration 1 happens without any flaw but for Iteration 2, “1062 HTML form not found” Runtime error message is encountered.

Kindly help me to get rid of this issue.

Krish.

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

RE: Users and Iterations in SilkPerformer

Jump to solution

Well, that is hard to tell remotely. You have to make sure, that each of your iterations ends on the same page as the iteration started on, otherwise the next iteration will be out of context. Did you doublecheck that in e.g. Truelog Explorer?

0 Likes
Highlighted
Absent Member.
Absent Member.

RE: Users and Iterations in SilkPerformer

Jump to solution

Hi Kris,

I assume that you have used default recording option [Page Level with Advanced Context Management Set to Level 2]. I would suggest that you re-record the script with Advanced Context Management Disabled [Profiles-->Record--> Web-->Recording Tab] or try and record the script with "Browser Level" API in Browser Level Option (This is second option) at the same path mentioned in my post above.

Thanks and Regards

Suraj Shankla

0 Likes
Highlighted
Absent Member.
Absent Member.

RE: Users and Iterations in SilkPerformer

Jump to solution

Hi Johannes,

I have made the context variable deleting statement out of the loop and hence the session context was maintained throughout the iteration for the Vuser.

Thanks...

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.