Modular Scripting Support in ZebraTester (V5.5-X+)

This new feature, introduced in ZebraTester V5.5-X, adds more granular functionality to the existing loop functions that already exist. Included is a quick video that is referenced by the timestamp below.

How to modularize a script

Use Case

In testing a scenario, a user only wants to log in one time, do multiple actions in the application, and, at the end of these application actions, the user wants to log out.

Background

Normally, in ZebraTester, for every loop, all the pages will execute, so the above scenario isn't possible using the outer loop for a Virtual User.

So what if you used an inner loop? While there's a possibility users can define inner loops around selected pages, which will execute as many inner loops that user set, there's still no way that ZebraTester can control the execution of the last page (for example log out) only at the last loop for a Virtual User.

So we can achieve this scenario in ZebraTester with (1) inner loops and (2) a plugin called "SupportModularScripts" which will be available as a part of the ZebraTester 5.5-X and higher installation.

Example Scenario Context/Requirements

  • A total of 5 pages in a script.

  • The first page and last page should only execute one time for a Virtual User.

  • Execute the first page on the first loop for a Virtual user.

  • Execute the last page on the last loop for a Virtual user.

The attaching video visualizes how to achieve this, the video has the replay of the script as well as a load test with multiple users.

 

Video Time Stamp & Step

Screenshot/Description

Video Time Stamp & Step

Screenshot/Description

Time 00:00

View of the script. (5 pages)

Page 1: Start Page

Page 2: Booking

Page 3: Media

Page 4 Shopping Cart

Page 5: Home

Time 00:12

Clicking into Page 1 (Start Page), the first call, to open the URL Details/Var Handler

Please Note:

  • Loop Counter Global Variable (LC)

  • Loop Variable (team)

  • Input File (team.txt)

  • Load Test Plug-in #1 (SupportModularScripts)

Time 00:26 Manage the Inner Loops from a Page.

Click on Page #1 (Start Page) link in Column 1 that opens up the Manage Page Dialog.

 

Time 00:29-39

Click on the magnifying glass on the loop to edit the conditions to the target inner loop and set the conditions of when to start the inner loop (from Page #1 (Start Page)).

 

The Inner Loops started from Page 1 are listed at the bottom of the Manage Page Dialog.

Time 00:47

Repeat for Page #5 (Home). Click on the Manage Page Column #1.

Time 01:02

Clicking on the magnifying glass for the Load Test Plug-in #1 (SupportModularScripts) will provide more detail on the plug-in and when it executes:

Time 01:17 through 02:01

The Replay the Recording starts and the results show that Pages #1 and 5 each ran once while the pages between them each ran 3 times in one minute.

Time 02:18

Delete the Global Variable LC and Define a new user variable “LC” in it's place, with the initial value set to “loop counter”

Time 02:42

The Inner Loop magnifying glass for Page 1 shows a similar Manage Page as before when the LC was set as a Global Variable, but now it’s a user variable.

Time 02:50

With the variable redefined, regenerate the Load Test.

Time 03:16

Re-execute for 2 Concurrent Users to show the User Variable effect on the loops.

Time 04:47

The revised LC user variable Test Results show that Pages #1 and 5 each ran twice while the pages between them each ran 18 times over the same 1 minute as our first run.