Deep Description on Runlogic
Types of Action files
- Vuser_init
- Action
- Vuser_end
Vuser_init
- This is the first action that is executed by the vuser and it comes under the init section of the script.
- It is executed only once in the life cycle of a vuser. By life cycle we mean the time between the start and the stop of a vuser.
- Even if the vuser has multiple iterations to execute, the set of steps incorporated within this action file is executed only once.
- We cannot disable/delete vuser_init. Even if it does not contain any steps to execute, it has to be present.
- We can put those steps in vuser_init that need to be executed only once. E.g. a script that logs in the same user to an application and performs certain tasks, since the same user is logging in every time, login steps can be put in vuser_init. But it also depends on the business requirement whether we should include launch and login in vuser_init. If launch and login is to be observed for its performance then including them in vuser_init is not recommended.
Action
- By default vuser creates an action file named as Action when we create/record a script. It comes under the run section of the script.
- Every time that a vuser iterates, the steps that are embedded within this file are executed.
- We can have multiple action files of this type in a script.
- We can disable/delete this action. The script can execute without it.
Vuser_end
- This is the last action file that is executed and it comes under the end section of the script. Like the vuser_init, the step within this actiona re alos executed once in the entire life cycle of a vuser.
- We cannot disable/delete vuser_end. Even if it does not contain any steps to execute, it has to be present.
- Like vuser_init, we can put steps that need to be executed once for the entire execution of a vuser.
Blocks
- A script can be divided in to three sections
- Init
- Run
- End
- Each of the above sections can be further divided in to one of more sub sections called blocks.
- Each block can contain one or more action blocks or simply actions.
- The blocks are particularly useful if we need to repeat a set of actions.
- Action blocks can be created in the run time settings of the LR script. To create a block, just select the section that and then click insert block or right click on the section and then select Insert Actions Block.
- The number of iterations for a block can be set in the properties of it.
- One thing to note is that only the block in the run section can have multiple iterations set. The ones in init and end section can set for single iteration only.
- Each block in the run section can be set to execute for different number of iterations.
- One thing to note is that only the block in the run section can have multiple iterations set. The ones in init and end section can set for single iteration only.
- Each block in the run section can be set to execute for different number of iterations.
- In the scenario shown above, we observe
- Run section has two blocks viz. Block0 and Block2.
- Each block has one action each.
- Run section will iterate 2 times.
- Each time in the run section, block0 will be executed 2 times and block1 will be executed 3 times.
- In total, block0 will be executed 2 X 2 times and block1 2 X 3 times.
Comments
Post a Comment