What is a RunLogic

RunLogic Overview

Runlogic allows user to create a custom flow to be executed by NetStorm. Before Runlogic was introduced, all the pages were executed in a sequential manner in the way they were recorded or if unless explicitly hard coded by the user. Earlier, there was limited control over execution of pages. Now, a good control over execution of pages has been implemented. No need to write complex code.

Without Run logic

  • All pages were executed sequential as described in script.c
  • Limited control over the execution of pages by NS variables

With Run logic

  • All pages/flows can execute as per requirement
  • Good control over execution of pages or on the group of pages (Blocks)

Example: To do complex things, such as: Two pages from login sequence and then do 20% times workflow A and 80% workflow B, both flows merged into 1 page of logout.

Components

  • Runlogic GUI: It is a Graphical user interface that allows user to add custom flows and the logic for the script to be executed. This all are stored in a C file.
  • NetStorm Runlogic Execution: This is a part of NetStorm core which executes the RunLogic.

Terms Used

  1. Blocks: Any node of tree having at least one child. A block can contain pages or another block within itself.
  1. Pages: A particular leaf node, all pages are taken from script itself. A page once used in any block can’t be defined again for the same.

Types of Blocks

There are following types of blocks supported in Runlogic:

  • Sequence Block: It is a sequence of pages or blocks. The pages or blocks defined under the sequence Block is executed sequentially as they are given (defined) in the RunLogic.
  • Abandon Block: This block doesn’t have any flow. When this block is hit the session is exited.
  • Percentage Block: It is a mix group of blocks or pages in certain % mix all-adding to 100%. NetStorm selects any of these block or pages at the execution time depending on the percentage given. Normally the page defined with more percentage is given advantage.
  • Weighted Block: It is similar to Percentage Block, but the weights do not add to a pre- determined number.
  • Switch Block: A user specified function returns the flow or block to be executed.
  • Count Block: A block or page may be executed specified number of count. A min and max count is specified.
  • DoWhile Block: A block or page may be executed as a do-while loop Condition for while is provided by a user specified function. Loop continues, till user specified function returns true.
  • While Block: It is similar to DoWhile Block. But unlike DoWhile Block, loop may not to be executed even a single time, depending upon the return value of the function.
  • Condition Block: This block contains flow having conditional statements. For example, if, then, else.

Rules for Adding Blocks or Pages

  • Flows can be added to the tree under the block node only.
  • The Block once added in the tree, must not become its own child. If this was allowed, it would enforce the blocks to have “iterative” property which was not allowed in the architecture.
  • The Pages are added in the same manner as blocks but the only difference is that they can be added under any block and its sub-blocks only once.

Recording Multiple Flows for a CTYPE Script

  1. Select existing WebC Type script which should have at least 1 recorded flow.
  2. Click on start recording button from Script Manager GUI (or press ALT+S)
  3. A window opens to provide the URL and flow information.
  4. After recording completes, click on Stop Recording button. There are two flows inside the same script. New flow file opens after recording completes. 

Working with RunLogic

User needs to follow the below mentioned steps:

  1. Open the Script Manager GUI and click the RunLogic icon 12 in the Script Manager toolbar. The RunLogic GUI is displayed.

1

Detail of options in RunLogic GUI

2

  • Add Node: To add a new node – Block or flow specifically under existing tree or to create a new one.
  • Show Properties: To show properties of a particular block if available.
  • Move Node Up: To move a particular selected node/flow up in the RunLogic tree.
  • Move Node Down: To move a particular selected node/flow down in the RunLogic tree.
  • Save RunLogic: This saves the RunLogic. This validates if all properties of blocks are satisfied before saving it.
  • Reset Tree: This resets the currently modified RunLogic to previously saved RunLogic.
  • Remove Node: To delete a node. Deleting a node deletes all the child nodes/flows present under it.
  • Expand: To expand the blocks and pages. This displays all blocks and pages inside the blocks.
  • Collapse All: To collapse the blocks and pages. This collapses all blocks and pages inside the blocks.
  • Download RunLogic Tree in XML format: This downloads the RunLogic tree in XML format. A file with the name runlogic.xml is created. User can save this file.
  • Open RunLogic Tree (PVS Auto-Calculation): This opens a new window where PVS can be auto-calculated based on the scenario type and the parameters provided.

Note: The user can now search a string by Suggested page name apart searching from Exact page name. This functionality is only applicable for the page name not for Block or Condition (if, else ..)

Record Another Flow (for multiple flows)

98_2

Adding Multiple Flows in RunLogic

If user wants to execute multiple flows in script, then he/she needs to add these flows in RunLogic by following the below mentioned steps:

  1. Open RunLogic GUI.
  2. Click on Add Node icon in tool bar.
  3. Click on Flow tab then select the flow from drop down list, for example FlightBooking1.

99

  1. Click Save, the flow is added in the RunLogic.

100

  1. Now, execute script with multiple flows.

Details of two flows (FlightBooking and FlightBooking1.c):

  • FlightBooking.c: This flow contains 7 pages
  • FlightBooking1.c: This flow contains 5 pages

Block type is sequential. So after execution of these two flows, 12 pages are executed in one Session.

Executing the Scripts

101Progress Report After Executing Two Flow Files of the Script

There are total 12 pages in the two flows. So, 12 pages should be executed in one session.

102Executed Pages in PageDump GUI

103

RunLogic Auto Calculation

If user provides the number of Vusers or session rate as an input in the RunLogic, then PVS (Page View per Second) is automatically calculated based on number of Vusers or session rate provided. To perform this operation, click the 3 icon on the RunLogic window. The RunLogic Run Progress window is displayed.

4

Here, to calculate the PVS, there are two options based on scenario types, such as FCU (Fixed concurrent user), and FSR (Fixed session rate).

FCU

For calculating PVS based on FCU scenario type, user needs to provide the following details:

  • Average page response time (in seconds)
  • Think time (in seconds)
  • Average page failure rate (in percentage)
  • Number of virtual users

After providing the required details, click the Calculate PVS button. The calculation is performed and PVS is displayed page-wise.

5

Multiple Runlogic

A script is a library of flow files which are tied together through runlogic. Netstorm supports running multiple runlogics for a library of flows. You can designate a default runlogic for any such collection.

For running multiple runlogics, you can make “n” number copies of a runlogic and use them in a script by changing the default runlogic. This will help in reusing the same script to run different flows. You can easily select the runlogic to be used in the test. Netstorm engine will execute default runlogic of script.

Change the Default Runlogic 

You can make a copy of runlogic as default, which will be used in script execution.

To change the default runlogic:

  1. Click the Copy Runlogic icon on the toolbar.
  2. The Copy RunLogic dialog box is displayed:

  1. Provide a new name for your RunLogic.
  2. Click OK. A message box is displayed states that the selected RunLogic is copied successfully.
  3. Click the Set Default RunLogic icon on the toolbar.

  1. Select the default RunLogic from the available list.

Delete a RunLogic 

  1. Click the delete icon.

2. Select a RunLogic from the available list of A confirmation message box is displayed.

3. Click OK.

Note: You cannot delete the Default RunLogic.

Rename a RunLogic 

  1. Click the Rename RunLogic icon .
  2. Select a RunLogic from the available list of Run logics.

3. Provide a name for your RunLogic.

4. Click OK.

How to Identify the default RunLogic from multiple available RunLogics? 

The name of the RunLogic is displayed in the Tree View list, as highlighted in the following figure: