We value your privacy
We use necessary cookies to make Loadero work. We ask for your permission to set additional cookies to understand site usage, make site improvements and to remember your settings. We also use cookies set by other sites to help deliver content from their services. See Cookie Policy for more info.
Skip to main content

Loadero constants

Loadero offers some constants that can be accessed in the script. Though the script itself is shared across all participants of the test, the participants have their own constants that can uniquely identify them within the test. Loadero constants hold information relevant to the participant that is executing the test such as:

  • unique identifier and name of a participant or of the group that the participant is in;
  • the participant's configuration fields values (such as video feed, location, etc.);
  • global test parameters such as test name, participant timeout, and start interval - these will be identical for all participants of the test.

The method of accessing these constants differs depending on the language. All available constants are given in the list below, followed by examples of how these may be useful.

note

As these are constants, they can only be accessed for reading and cannot be changed during the test run itself. Their values are initialized when the test begins execution.

Loadero constants are available through the client.globals directive. All of the constants provided below should be prefixed with client.globals., e.g., client.globals.participant.globalID.


  • participant.globalID (Number): an ID that uniquely identifies the participant across the whole test. These IDs start from 0 and are sequential, i.e., a test with 60 participants will have participant.globalID values ranging from 0 to 59.
  • participant.id (Number): an ID that uniquely identifies the participant within its group. If there are multiple groups in the test, then this ID may occur multiple times across the whole test. These IDs start from 0 within each group and are sequential, i.e., a test with 2 groups of 10 participants will have participant.id values ranging from 0 to 9 in each group.
  • participant.name (String): name of the participant as had been defined in its participant configuration.
  • group.id (Number): an ID that uniquely identifies the group that the participant is in. This ID is unique across the whole test. These IDs start from 0 and are sequential, i.e., a test with 10 groups will have group.id values ranging from 0 to 9.
  • group.name (String): name of the group as had been defined in the group's configuration.
  • run.id (Number): an ID that uniquely identifies the run across all runs ever executed. This ID will never reoccur for any other test run. This value will be identical for all participants in the test run. This ID is generated dynamically at the time of launching the test run and attempting to predict it is not recommended.
  • run.participant.id (Number): an ID that uniquely identifies the participant across all runs ever executed. This ID will never reoccur for a participant in any test. These IDs are generated dynamically at the time of launching the test run and attempting to predict them is not recommended.
  • test.name (String): name of the test being executed, as had been defined in the test configuration.
  • test.participantTimeout (Number): participant timeout of the test being executed, as had been defined in the test configuration. The value is in seconds.
  • test.startInterval (Number): start interval of the test being executed, as had been defined in the test configuration. The value is in seconds.
  • test.totalParticipants (Number): the total amount of participants that are being simulated by the test run.
  • audioFeed (String): the configured audio feed value for the participant.
  • browser (String): the configured browser version for the participant.
  • computeUnit (String): the configured amount of compute units for the participant.
  • location (String): the configured location for the participant.
  • network (String): the configured network conditions for the participant. This considers only the network conditions the user was initialized with. If the updateNetwork() command has been used to update the network configuration, then the Loadero constant will still reference the original configuration.
  • videoFeed (String): the configured video feed for the participant.

Sample Usage

The example given below only aims to demonstrate how the variables could be used but any websites and selectors referenced are made up, the script isn't actually valid and executing it will result in a failed test.

Example of a digital conference test with multiple rooms
client => {
client
// Each group of participants will have their own room
.url(`https://somewebrtcsite.com/?roomId=${client.globals.group.id}`)
// Set a unique name for each participant for tracking purposes
// E.g., "P0", P1", and so forth
.setValue(
"#username",
"P" + client.globals.participant.globalID
)
.click("#joinRoom");

// Assuming that everyone is muted automatically
// Everyone who isn't designated to stay muted should unmute
if (client.globals.participant.name !== "MutedAttendee") {
client.click("#unmute");
}

// Remain in the call for 15 minutes
client.pause(15*60*1000);
}