Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Step

Illustration

1. Prepare a Session with one "Non Executable" URL Call

First, you need a recorded session that contains only one URL call (that never will be executed).

If you haven’t created any session, you can use the PageScanner tool or the Add URL to session. Or, you can load any existing session and remove all URL calls except the first one from that session and set the User's Think Time to a value of zero.

2. Configure the URL call as "non-executable"

For this example, we are going to take the URL call to the Apica Website and step you through the ZebraTester UI as to how to mark the call as non-executable. This is a special case as you would not normally do this except for a JUnit test case.

  1. Click on URL

  2. In the URL Details/Var Handler Edit the HTTP Request

  3. Click either of the Special Options buttons/Icons to set the flag to ON or OFF

  4. Place a check in the “Disable the execution of the URL during Load Test”

  5. Apply the Special Option

Image RemovedImage AddedImage RemovedImage Added

Return to the main menu

Click refresh to reload the current page.

The URL call should now be shown with a yellow exclamation mark. ⚠

Add the JUnit Packages and the Test Package to the Session

By clicking from the (1) ZebraTester Main Menu on the URL that we set as non-executable, we open the Var Handler page, and from that, we (2) look for the grey folder icon that opens the Declare External Resources (for Self-Developed Plug-ins) menu.

At the Declare External Resources menu and (3) add all Java *.jar files that are needed to execute the JUnit test.

This means that you have to add the jar files of JUnit itself (for example, junit-4.11.jar and hamcrest-core-1.3.jar) and the jar file that contains your JUnit test (for example CollectionTest.jar), so you end up with a table/list of all declared external resources at the bottom of the dialog.

Info

Note: We are continuing with the Apicasystems.com URL from above.

Adding a System Properties File (Optional)

You can also declare a System Properties File as an external resource. Such a file will be parsed on the load generators just before the JUnit tests are executed. The key and values of such a file are stored in the Java virtual machine as system properties.

(lightbulb) Hint: To debug the parsing of such a file you can enable the option "debug loops" when starting a load test. The debug output is written to the *.out file of the load test job.

The lines of the file can contain the following commands:

  1. key = value

  2. .includeProps = "<include-file-name>"

  3. .includeProps = ["<include-file-name-1>", "<include-file-name-2>", ... , "<include-file-name-N>"]

  • If a value ends with a backslash (\) the next line is appended to the value.

  • Lines that are staring with a hash sign (#) are ignored.

Example saved and declared as an External Resource called “SystemProperties.txt”:

# General settings

loggingBufferSize = 1000

memoryStatsEnabled = true

# JSON data

jsonRequest = {\

     "defaultID": 1, \

     "keys": [\

          {"id":1, "type":"A25", "value":"57FCCA5C9F39BC2E73B5"}, \

     ],\

}

...

Once the Plug-In was generated navigate in the Project Navigator to that directory in which the load test program should be generated.

...

Generating the Load Test Program

...

with a JUnit Load Test Plug-In (WIP)

Generating the Load Test Program and Executing the Load Test can be done as usualnormal, however, there will be additional steps to gather/zip the external resource files.

JUnit Best Practices (WIP)

...