Skip to content
  • ZipCode Api
  • Blog
  • About RedLine13
RedLine13
RedLine13
Primary Navigation Menu
Menu
  • Start Testing
  • Demo
  • Pricing
  • JMeter
  • Partners
  • Docs
    • Documentation Home
    • AWS Set Up for load testing
    • AWS Approval for Large Tests
    • PHP, NodeJS, Python Load Tests
    • Scalability
    • Jenkins Plugin Setup
    • Premium Features
    • Knowledge Base

How to access RedLine13 Test and Server IDs from JMeter

By: David Koziel

Visibility of test ID and server ID properties.

We have recently released a new feature that allows JMeter to access the RedLine13-assigned Test ID as well as the Server ID directly from the test plan. If you already know how JMeter exposes options set at the command line, accessing this information will be familiar. (Otherwise, you may want to refer to this post for some additional context.) This information will be undoubtedly useful for a variety of purposes. However, one specific example would be in conjunction with using third-party integrations to visualize your test metrics, as something we have covered in a previous blog post (e.g., using InfluxDB and Grafana).

To review the command line syntax for importing JMeter custom properties, let us consider the following expression:

    -J[prop_name]=[value] 

Tests run through RedLine13 now internally add two properties to the JMeter command line: serverid for the unique ID of the load agent instance, and testid containing the sequential RedLine13 test number. This makes them accessible from JMeter test plans through a number of different ways, however the most straightforward means is using the built-in “__P()” function and ${…} notation.

If this fits your use case, you can enter ${__P(rl13_serverid)} and ${__P(rl13_testid)} into samplers, header and parameter tables, and many more places with no actual code required. An example of this can be found below, which echoes both properties to another web request:

          * should be __P(rl13_serverid), __P(rl13_testid) in the image

In the event that you need to access these properties from within a script (e.g., BeanShell or JSR223) the process is similar, but the notation is slightly different. Instead, use the built-in props object by invoking “props.get(“rl13_serverid”)” or “props.get(“rl13_testid”)” as outlined in the JMeter documentation here. A simple example that assigns these properties to values is as follows:

    String __serverid = props.get(“rl13_serverid”); 

    String __testid = props.get(“rl13_testid”); 

This is of course a basic example providing access to test and server ID properties within your test plan. If you do not already have an account, you can sign up for a free RedLine13 trial subscription which will allow you to test out this feature for yourself.

2021-03-24
Previous Post: Accessing JMeter Properties set as Command Line Options
Next Post: Getting Started with the RedLine13 API

Recent Posts

  • Order of Elements in JMeter
  • The JMeter Synthesis Report
  • Using the JMeter Plugins Manager
  • JMeter Rotating JTL Listener
  • Using Test Fragments in JMeter Tests

Related

  • Order of Elements in JMeter
  • The JMeter Synthesis Report
  • Using the JMeter Plugins Manager
  • JMeter Rotating JTL Listener
  • Using Test Fragments in JMeter Tests
  • Step-by-Step Guide to Testing with JMeter
  • Functional Testing vs Performance Testing
  • A Gentle Introduction to Load Testing
  • Using the JMeter Counter Element
  • Getting a “Grounded” Test to Launch

© RedLine13, LLC | Privacy Policy | Contract
Contact Us: info@redline13.com

Designed using Responsive Brix. Powered by WordPress.