4. Execution Control - Inner Loops

It is possible to define “inner loops,” including only some web pages of a recorded web surfing session.

Using Inner Loops

For example, inner loops can be used during a load test after the users log in to repeat the web pages between login and logout several times before logout.

During the load test, inner loops execute within the "outer" normal loops (repetitions of the web surfing session per user); for example, if you run a load test with 10 users and 3 loops (with an unlimited test duration), each user will execute the recorded web surfing session 3 times. Within each repetition (outer loop), the inner loop(s) will be executed.

Inner loops must be composed of entire web pages, and not only a subset of URL calls to a single web page; however, you can define additional page breaks between URL calls after the recording has been completed.

 

 

You can define an inner loop by clicking on the item index on the left side of a page break.

 

Inner Loop Configuration

Inner Loop Description

description of the inner loop (mandatory).

Inner Loop End Page

the end page of the inner loop, including all URLs, calls on the end page itself.

Loop Iterations

the number of iterations. This can be a fixed value or a variable value extracted, for example, from an Input File or a User Input Field.

Action if the planned duration of Load Test exceeded

the option "Abort current loop after current iteration" means that at the end of the load test - when the maximum duration of the test has elapsed - the inner loop is aborted after the end of the current iteration, and remaining iterations are not executed. The option "Continue with iterations" means that the load test's end will be postponed until all iterations have been completed.

Enable Pacing

enabling this option sets a minimum elapsed time for all "in one iteration" executed page breaks and URL calls before the next iteration can start. If the iteration is done faster than the pacing time, the "user" will be inactive until the pacing time has elapsed.

 

Inner loops are marked by black bars on the left side of the Web Admin GUI main menu. Nested inner loops are also supported.

 

 


Conditional Execution of Parts of the Web Surfing Session

If a variable controls the number of iterations of an inner loop, the value of such a variable can also be 0 (zero). A value of zero means that a simulated user does not execute (enter) the inner loop. This can be used in combination with an Input File whose file scope is “newline per user” or “newline per loop” and whose lines contain values of zero and one which is assigned to the variables of the iterations; that is, some of the users skip parts of the recorded web surfing session during the load test.

 

However, to get valid statistical data, it is required that, at least once during the load test, at least one user executes the inner loop one or more times.

 


Break and Continue Conditions in Inner Loops

After you have defined an inner loop, you can also define additional conditions that allow you to control the run-time behavior inside an inner loop. If such an additional condition applies (becomes true), the corresponding action can be break or continue.

Break means: jump out of the inner loop. After a "break," the simulated user will call the next URLCall after the inner loop.

Continue means: jump back at the start of the inner loop without calling the subsequent URLCalls of the current iteration inside the inner loop. However, such a jump is not executed during the last iteration of an inner loop. In such a case, the inner loop is immediately finished (similar to the "break" condition but includes incrementing the inner loop iteration counter).

Additionally, ZT supports reporting a "red" fatal error after all iterations of an inner loop have been executed (no "break" was made in an iteration before the last iteration). If such a "red" fatal error is reported, the simulated user will abort the current "Outer Loop" and will start the next "Outer Loop."

 

The Text Input Fields of the conditions can contain fixed text as well as placeholders for variables. Example: Dear {\$vTitle} {\$vName}.

Also, ZT supports defining a NOT condition for the absence of a text. This can be done by enfolding the whole text with an exclamation mark and square brackets. Example: Dear {\$vTitle} {\$vName}.

Restrictions: if nested inner loops have been defined, a "continue" or a "break" action will only change the deepest inner loop's run-time behavior. Breaking through several inner loop levels is not supported.

Further Tips for Using Variables: when using variables, please also consider the variables' scope (page 32). If the scope is global, all simulated users will see the same value for such a variable, and therefore the same condition will become true or false for all users. On the other hand, if the scope of a variable is user or loop, each simulated user will see a different value for such a variable. Therefore the conditions will be calculated on a per-user basis.

Can't find what you're looking for? Send an E-mail to support@apica.io