Loadero 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. The method of accessing these variables differs depending on the language.
- JavaScript + Nightwatch.js
- Java + TestUI
- Python + Py-TestUI
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.
Variables are available through globalConfig
variable via getters.
globalConfig.getParticipant().getGlobalId()
(Integer): ID of participant that is executing the test. This ID is unique inside whole test.globalConfig.getParticipant().getId()
(Integer): ID of participant that is executing the test. This ID is unique inside a group.globalConfig.getParticipant().getName()
(String): name of the participant as defined in the participant configuration.globalConfig.getGroup().getId()
(Integer): ID of the group of given participant which is executing the test. This ID is unique within the test run.globalConfig.getGroup().getName()
(String): name of the group as defined in the group configuration.globalConfig.getRun().getId()
(Integer): ID of this test run.globalConfig.getRun().getParticipant().getId()
(Integer): ID of the given run participant. The ID is globally unique and therefore will never match across all test runs.globalConfig.getTest().getName()
(String): name of current test.globalConfig.getTest().getParticipantTimeout()
(Integer): participant timeout in seconds of test.globalConfig.getTest().getStartInterval()
(Integer): start interval in seconds of test.globalConfig.getTest().getTotalParticipants()
(Integer): total participant count in test.globalConfig.getAudioFeed()
(String): audio feed of given participant.globalConfig.getBrowser()
(String): browser version used by given participant.globalConfig.getComputeUnit()
(String): compute unit of given participant.globalConfig.getLocation()
(String): location of given participant.globalConfig.getMediaType()
(String): media type of given participant.globalConfig.getNetwork()
(String): network conditions of given participant.globalConfig.getVideoFeed()
(String): video feed of given participant.
Variables are available through GLOBALS
constant using the following methods:
GLOBALS.participant.global_id
(int): ID of participant that is executing the test. This ID is unique inside whole test.GLOBALS.participant.id
(int): ID of participant that is executing the test. This ID is unique inside a group.GLOBALS.participant.name
(str): name of the participant as defined in the participant configuration.GLOBALS.group.id
(int): ID of the group of given participant which is executing the test. This ID is unique within the test run.GLOBALS.group.name
(str): name of the group as defined in the group configuration.GLOBALS.run.id
(int): ID of this test run.GLOBALS.run.participant.id
(int): ID of the given run participant. The ID is globally unique and therefore will never match across all test runs.GLOBALS.test.name
(str): name of current test.GLOBALS.test.participant_timeout
(int): participant timeout in seconds of test.GLOBALS.test.start_interval
(int): start interval in seconds of test.GLOBALS.test.total_participants
(int): total participant count in test.GLOBALS.audio_feed
(str): audio feed of given participant.GLOBALS.browser
(str): browser version used by given participant.GLOBALS.compute_unit
(str): compute unit of given participant.GLOBALS.location
(str): location of given participant.GLOBALS.media_type
(str): media type of given participant.GLOBALS.network
(str): network conditions of given participant.GLOBALS.video_feed
(str): video feed of given participant.
Sample Usage
- JavaScript + Nightwatch.js
- Java + TestUI
- Python + Py-TestUI
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}`
);
}
public void testUIWithLoadero() {
System.out.printf(
"running participant %s with id %d in group %s with %d id in test %s",
globalConfig.getParticipant().getName(),
globalConfig.getParticipant().getId(),
globalConfig.getGroup().getName(),
globalConfig.getGroup().getId(),
globalConfig.getTest().getName()
);
}
def test_on_loadero(driver: TestUIDriver) -> None:
print(
f"running participant {GLOBALS.participant.name} "
f"with id {GLOBALS.participant.id} in group "
f"{GLOBALS.group.name} with {GLOBALS.group.id} "
f"id in test {GLOBALS.test.name}",
)