Versions Compared

Key

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

Inline Scripts

...

Inline Scripts allow you to enhance the load test program with additional features. For example: Modify the , you can use inline scripts to modify HTTP request data before transmitting an a URL call , or extracting extract data fragments from HTTP responses into variables. This is similar to what you can do with The goal of Inline Scripts is to allow much of the functionality available to users via Load Test Plug-Ins. but in a simpler way. Inline Scripts can also abort manner.

Common use cases for inline scripts include:

  • printing additional information regarding script execution (for example, the loop number of a For loop which is executed via inline script)

  • aborting the current executed loop of a user and

...

  • triggering a

...

  • Fatal URL error snapshot

  • adding a custom failure message to the ASM GUI via the “Error Log” found on the ZT Check Result page:

    Image Added
Note

Contact your TAM or Support if you would like a demo on the full capabilities of inline scripting (including any of the above use cases). We will have a Professional Services team member review your use case and assist with implementation.

Inline Scripts are written in Prx BASIC the ZebraTester-specific “ZT BASIC” programming language. The runtime behavior of Inline Scripts can be tested in advance, whereby the script environment is simulated based on the data of the recorded session.

For full documentation see the attached Prx BASIC Language Reference Manual:

View file
nameZTBasicLanguageReferenceManualEn.pdf

...

Info

A complete overview of ZT BASIC syntax and usage can be found within the Documentation subfolder of your local ZebraTester installation. The manual is not available via the KnowledgeBase as syntax can differ significantly between ZebraTester versions. In addition, you can access Inline Script functions by opening the Inline Script editor and pressing the ctrl + spacebar keys (see “Add a New Inline Script” and “Edit an Existing Inline Script”).

Accessing the Inline Script Editor

To access the Inline Script editor from within ZebraTester, open a ZebraTester script and navigate to the “URL Details / Var Handler” page by clicking on any of the URLs:

...

In the “Var Handler” section, you will see a section called “Inline Scripts”. In the above screenshot, you can see this script contains an inline script called “forceAbort”.

Add a new Inline Script

To add a new Inline Script, click on the “Add Inline Script” button in the “Inline Scripts” section:

...

The “Add Inline Script” dialog will appear with completely blank fields:

...

Edit an Existing Inline Script