Sunday, September 13, 2009

Actions in Depth

As discussed earlier when we record a script we have 3 section Vuser_init, Action and Vuser_end.Lets discuss about the action in detail: There can be more than one action in a script. Its always help to have multiple actions in your script. Eg : If you are recording logging into mail, checking mails, sending mails, checking the sent mails, deleting mails then you could arrange / record in the below way:
Action 1:Checking mails
Action 2:Sending mails
Action 3:Checking sent mails
Action 4:Deleting mails
You can also rename the actions as you wish, if you want to follow specific naming conventions. I always suggest to follow specific naming conventions.
  • You can rename during recording or by right clicking on the particular action after recording.
  • You can always delete the actions which you don’t require in your scripts.
  • You can always create new action even after recording.
  • You can import action from other scripts too. Parameters associated with the imported action, will be merged with the existing script.
  • You Can insert action blocks which are group of actions and you can configure each action block independent of each other.

See the below example:

  • This script is developed to just open the Google page. This is placed in the Vuser_init.
  • We have created action block(0) under Action section.
  • Inside action block(0) we have inserted Vuser_init (Which infact calls / runs the Vuser_init section of our script , opening of google page)
  • We have choosen to run the main action for 2 iteration and the action block for 3 iterations.
  • When we kick off this run, you can observe the way it goes as explained below:

How the script is executed is explained below:

  • Main Vuser_Init runs for one iteration.
  • Run (x2) which is shown below has to execute twice.
  • First time Run (x2) executes, under this the Action is executed once and Block0 (x3) is executed for 3 times as we have set the property of this such that it executes for 3 times. That means our original Vuser_init ( which opens google page) is executed thrice.
  • Second time Run (x2) executes, under this the Action is executed once for second time and Block0 (x3) is executed for 3 times as we have set the property of this such that it executes for 3 times. That means our original Vuser_init ( which opens google page) is executed thrice for second time.
  • As Run(x2) has executed for 2 times it comes out of Run action and moves to Vuser_end action.
  • Vuser_end is executed for one time and the run is completed. Note: You can set the actions inside the action block to execute randomly or sequentially. This is self explanatory guys and I hope you understand it.


No comments:

Post a Comment