TestUI (Java) commands

Loadero uses TestUI (Java) and Selenium Nightwatch to handle participant action simulation.

TestUI documentation can be found here.

TestUI offers a lot of their own commands to handle interaction with browser. Full feature support for TestUI is still in progress.

Available imports from TestUI


  • testUI.Utils.TestUIException
  • testUI.collections.UICollection
  • testUI.elements.UIElement
  • testUI.BrowserLogs Static
  • testUI.UIOpen.open
  • testUI.UIOpen.navigate
  • testUI.UIUtils.putLog
  • testUI.UIUtils.executeJs
  • testUI.Utils.AppiumHelps.sleep
  • testUI.Utils.By.*
  • testUI.elements.TestUI.E
  • testUI.collections.TestUI.EE
  • testUI.TestUIDriver.getSelenideDriver

Available script variables

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

  • globalConfig.getParticipant().getId() (Integer): ID of participant that is executing test. This ID is unique inside group
  • globalConfig.getParticipant().getName() (String): name of participant as defined in participant configuration
  • globalConfig.getGroup().getId() (Integer): ID of group in which participant is executing test. This ID is unique within test run
  • globalConfig.getGroup().getName() (string): name of group as defined in group configuration
  • globalConfig.getRun().getId() (Integer): ID of this test run
  • globalConfig.getTest().getName() (String): name of current test
  • globalConfig.getNetwork() (String): network conditions of this participant
  • globalConfig.getBrowser() (String): browser version used
  • globalConfig.getMediaType() (String): media type of simulated audio/video feed
  • globalConfig.getLocation() (String): region where current participant is located

Script examples

Locating elements

By using CSS selector

UIElement element = E(byCssSelector("your.Id"));

By using ID

UIElement element = E(byId("your.Id"));

By using xpath

UIElement element = E(byXpath("//some"));

It is possible to use all strategies by switching back and forth.


public void test() {
      // Wait for page to load up
      // Find join button and click on it
   // Wait for 10 seconds
   sleep(10 * 1000);
public void testGoogleSearch() {
    // Wait for page to load up
    // Find search bar
    // Type 'loadero' in it
    // Find search button and click it

Using TestUI Element Assertion methods


You can find detailed descriptions and more examples in TestUI wiki

Custom commands

Set file into file input field

setFile(By selector, String fileName);

Allows to set one of Loadero sample files into file input field.

The selector parameter specifies input field element selector, e.g. input[type="file"], input#file-upload.

The fileName parameter specifies chosen file name.

Available test files

For now, one of predefined test files can be chosen. Available files:

File name (fileName) Type Size
loaderoSample100KB.png PNG 100KB
loaderoSample1MB.png PNG 1MB
loaderoSample5MB.png PNG 5MB
loaderoSample30MB.png PNG 30MB
loaderoSample100MB.txt TXT 100MB

In case there is a need for other file format or size, feel free to contact us.


public void testUIWithLoadero() {

  setFile(byCssSelector("input[type=FILE]"), "loaderoSample100KB.png");


Set User-Agent

setUserAgent(String userAgent);

Changes User-Agent header for outgoing requests. To switch back to original user agent, call the function with empty value.

The userAgent parameter specifies prefered User-Agent header value.


public void testUIWithLoadero() {
  // Open page and create screenshot with default User-Agent

  // Set custom User-Agent header

  // Refresh page

  // Wait for page to load and create screenshot with changed User-Agent

  // Reset User-Agent header to default value

  // Refresh page

  // Wait for page to load and create screenshot with default User-Agent

Update network conditions during test

updateNetwork(String networkMode);

Updates network conditions for participant while the test is running.

The networkMode parameter specifies what network conditions should be used. Available network configurations and networkMode parameter values can be found here.


public void testUIWithLoadero() {

  // Update network condition to 4g value

results matching ""

    No results matching ""