What is a RunLogic
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.
- 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.
- Blocks: Any node of tree having at least one child. A block can contain pages or another block within itself.
- 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 the 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, the 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 C Type Script
- Select existing WebC Type script which should have at least 1 recorded flow.
- Click on the start recording button from Script Manager GUI (or press ALT+S)
- A window opens to provide the URL and flow information.
- After the recording completes, click on the Stop Recording button. There are two flows inside the same script. A new flow file opens after the recording completes.
Working with RunLogic
The user needs to follow the below-mentioned steps:
- Open the Script Manager GUI and click the RunLogic icon in the Script Manager toolbar. The RunLogic GUI is displayed.
Detail of options in RunLogic GUI
- Add Node: To add a new node – Block or flow specifically under an existing tree or to create a new one. Click icon.
- Show Properties: To show properties of a particular block if available. Click icon.
- Move Node Up: To move a particular selected node/flow up in the RunLogic tree. click icon.
- Move Node Down: To move a particular selected node/flow down in the RunLogic tree. click icon.
- 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.click icon.
- Remove Node: To delete a node. Deleting a node deletes all the child nodes/flows present under it. click icon.
- Expand: To expand the blocks and pages. This displays all blocks and pages inside the blocks.click icon.
- Collapse All: To collapse the blocks and pages. This collapses all blocks and pages inside the blocks. click icon.
- Download RunLogic Tree in XML format: This downloads the RunLogic tree in XML format. A file with the name runlogic.xml is created. Users can save this file, click the icon.
- 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 click icon.
- Copy RunLogic. To copy RunLogic click
- Set Default RunLogic: To set RunLogic as default, click
- Delete RunLogic: To delete RunLogic click icon.
- Rename RunLogic: To rename a RunLogic, click on the icon.
Note: The user can now search a string by Suggested page name apart from searching from the 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)
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:
- Open RunLogic GUI.
- Click on Add Node icon in the toolbar.
- Click on the Flow tab then select the flow from the drop-down list, for example, FlightBooking1.
- Click Save, and the flow is added in the RunLogic.
- 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
Progress 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.
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 a number of Vusers or session rate provided. To perform this operation, click the icon on the RunLogic window. The RunLogic Run Progress window is displayed.
Here, to calculate the PVS, there are two options based on scenario types, such as FCU (Fixed concurrent user), and FSR (Fixed session rate).
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.
A script is a library of flow files that 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 the default runlogic of the 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:
- Click the Copy Runlogic icon on the toolbar.
- The Copy RunLogic dialog box is displayed:
- Provide a new name for your RunLogic.
- Click OK. A message box is displayed states that the selected RunLogic is copied successfully.
- Click the Set Default RunLogic icon on the toolbar.
- Select the default RunLogic from the available list.
Delete a RunLogic
- 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
- Click the Rename RunLogic icon .
- 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: