Printer FriendlyEmail Article Link

How do I delay HTTP requests in Avalanche?

Answer

You can delay any action list item through the use of the THINK command. Here are the details from the Avalanche online help that can be accessed by pressing the F1 key while you are in the Avalanche GUI.

Think Time

The THINK action introduces a delay between actions in an Action list. For example, a simulated user may access a website, then pause for 10 seconds before proceeding with the next website.
 
When you use the THINK action in between two actions, the value that you specify is the amount of delay in milliseconds (e.g., 10000 for 10 seconds) before the next request in the Action list is processed. You can specify a literal value, a forms database reference, or a random number with the THINK command.
 
IMPORTANT: The delay that you specify with the THINK command is added to the User Think Time that you specified in the Client Profile. In addition, you must select the User Think Time checkbox on the Client Profile tab. If the checkbox is deselected, then think time is disabled for the test.
 
NOTE: The SLEEP command provided in previous versions of Avalanche is still supported.
 

Syntax and Examples

  • Set a think time of 10 seconds
    THINK<10000>
  • Assign a literal value of 10 seconds
    ASSIGN VARIABLE <time1 10000 >
    THINK<time1>
  • Assign a forms database reference
    ASSIGN VARIABLE <time1 formsdb.$1>
    THINK<time1>
  • Assign a random number
    ASSIGN VARIABLE <time1 ###>
    THINK <time1>
  • Embed random uniform distributed think times, ranging from 10 to 30 seconds
    ASSIGN VARIABLE <rand UNIFORM 10000 30000>
    THINK <rand>
  • Sleep six seconds between two level 1 Actions
    1 GET http://192.168.42.11/index1.html
    THINK <6000>
    1 GET http://192.168.42.11/index2.html
  •  In the following three examples, the level 2 Actions will be executed immediately after the first level 1 Action, and the second level 1 Action will wait 6 seconds. NOTE: The THINK command always gets executed prior to the next level 1 Action, even if it is appears before a level 2 Action. 
    • Example 1
      1 GET http://192.168.42.11/index1.html
      THINK <6000>
      2 GET http://192.168.42.11/index2.html
      2 GET http://192.168.42.11/index3.html
      # 6-second delay occurs here
      1 GET http://192.168.42.11/index4.html
    • Example 2
      1 GET http://192.168.42.11/index1.html
      2 GET http://192.168.42.11/index2.html
      THINK <6000>
      2 GET http://192.168.42.11/index3.html
      # 6-second delay occurs here
      1 GET http://192.168.42.11/index4.html
    • Example 3
      1 GET http://192.168.42.11/index1.html
      2 GET http://192.168.42.11/index2.html
      2 GET http://192.168.42.11/index3.html
      THINK <6000>
      # 6-second delay occurs here
      1 GET http://192.168.42.11/index4.html
  • Four times six-second think times equals a 24-second delay before the next Action is executed
    1 GET http://192.168.42.11/index1.html
    THINK <6000>
    THINK <6000>
    THINK <6000>
    THINK <6000>
    1 GET http://192.168.42.11/index2.html

Product : Avalanche,L4-7,App Testing,Avalanche,HTTP