Variables

Variables #

Loadero offers some variables that can be accessed in the script. These variables hold information relevant to the participant that is executing the test. Variables are available through client.globals directive.

  • client.globals.participant.globalID (Number): ID of participant that is executing the test. This ID is unique inside whole test.
  • client.globals.participant.id (Number): ID of participant that is executing the test. This ID is unique inside group.
  • client.globals.participant.name (String): name of the participant as defined in the participant configuration.
  • client.globals.group.id (Number): ID of the group of given participant that is executing test. This ID is unique within test run.
  • client.globals.group.name (String): name of the group as defined in the group configuration.
  • client.globals.run.id (Number): ID of the given test run.
  • client.globals.run.participant.id (Number) ID of the given run participant. The ID is globally unique and therefore will never match across all test runs.
  • client.globals.test.name (String): name of the current test.
  • client.globals.test.participantTimeout (Number): participant timeout in seconds of test.
  • client.globals.test.startInterval (Number): start interval in seconds of test.
  • client.globals.test.totalParticipants (Number): total participant count in test.
  • client.globals.audioFeed (String): audio feed of given participant.
  • client.globals.browser (String): browser version used by given participant.
  • client.globals.computeUnit (String): compute unit of given participant.
  • client.globals.location (String): location of given participant.
  • client.globals.mediaType (String): media type of given participant.
  • client.globals.network (String): network conditions of given participant.
  • client.globals.videoFeed (String): video feed of given participant.

Sample Usage #

client => {
    console.log(
        `running participant ${client.globals.participant.name} ` +
            `with id ${client.globals.participant.id} in group ` +
            `${client.globals.group.name} with ${client.globals.group.id} id ` +
            `in test ${client.globals.test.name}`
    );
}