Environment variables
At the start of your flood we will initialize some environment variables and system properties which can be of use when designing your tests.
In addition to the following system properties and environment variables, you can also pass in your own environment variables by uploading a KEY=VALUE format text file called environment (with no file extension) along with your other test assets.
Some further guidelines about syntax and configuration:
  • each line in an env file to be in VAR=VAL format.
  • Lines beginning with # (i.e. comments) are ignored.
  • Blank lines are ignored.
  • There is no special handling of quotation marks.
  • Please do not use special characters such as periods (.) in the variable name.
  • Please do not upload a conf/gatling.conf file in your user files as this will override the node's own configuration and most likely break the reporting plugin (by not specifying the correct writers). If there's something you need in there just let us know.
When providing an environment file, this is loaded into the container's OS environment the same as any system environment variable. So these aren't JVM properties / parameters, rather they are system environment variables. ​

Examples

JMeter Environment Example

In order to retrieve a system environment variable in JMeter you can refer to the variable in your script as follows:
1
${__P("VARIABLE")}
Copied!

Gatling Environment Example

In Scala, you are able to refer to the variable as follows:
1
sys.env.get("VARIABLE")
Copied!
This will return an Option[String].

Element Environment Example

1
ENV.VARIABLE
Copied!
Note that with Element you'll also have to import ENV like this:
1
import { step, TestSettings, Until, By, Browser, TestData, ENV } from '@flood/element'
Copied!

Default Flood Environment Variables

The following environment variables will also be set across all tools.

Grid region

1
FLOOD_GRID_REGION=us-east-1
Copied!
The canonical AWS region in which the grid is located.

Grid sequence ID

1
FLOOD_GRID_SEQUENCE_ID=N
Copied!
The grid's sequential ID expressed as an integer for your account.

Node sequence ID

1
FLOOD_GRID_NODE_SEQUENCE_ID=N
Copied!
The grid node's sequential ID expressed as an integer for your account.

Grid index

1
FLOOD_GRID_INDEX=N
Copied!
A zero based index to indicate which grid the flood is running on based on the total number of grids the flood is distributed to.

Node index

1
FLOOD_NODE_INDEX=N
Copied!
A zero based index to indicate which node of a grid the flood is running on based on the total number of nodes in any particular grid the flood is distributed to.

Flood sequence ID

1
FLOOD_SEQUENCE_ID=N
Copied!
The flood's sequential ID expressed as an integer for your account.

Project ID

1
FLOOD_PROJECT_ID=N
Copied!
The flood's project ID expressed as an integer for your account.

Thread ID

1
THREAD_ID=N
Copied!
For Selenium tests, a one based index to indicate the browser / thread ID, expressed as an integer.

System Properties

The following system properties are set at the start of your test:
1
-Dgrid_index=N
Copied!
grid_index is a zero based index to indicate which grid the flood is running on based on the total number of grids the flood is distributed to.
1
-Dnode_index=N
Copied!
node_index is a zero based index to indicate which node of a grid the flood is running on based on the total number of nodes in any particular grid the flood is distributed to.
1
-Dthreads=N
Copied!
threads is an integer value that corresponds to the threads parameter you set in the Flood user interface.
1
-Drampup=N
Copied!
rampup is an integer value that corresponds to the rampup parameter you set in the Flood user interface, expressed as seconds.
1
-Dduration=N
Copied!
duration is an integer value that corresponds to the duration parameter you set in the Flood user interface, expressed as seconds.
Note: these same properties are expressed as JMeter properties at run time
e.g. -Jthreads=100
Last modified 1yr ago