Skip to main content

Examples - Java Grid Execution

SeeTest Client - Using Grid Execution

SeeTest Client - Using Grid Execution
GridClient gridClient = new GridClient("cloudUsername","cloudPassword","cloudProject","https://cloud.experitest.com");
Client client = gridClient.lockDeviceForExecution("testname", "@os='android'", 60, TimeUnit.MINUTES.toMillis(2));

Create a new GridClient. Fill in the user credentials, details about the cloud server and the project to log into:

GridClient(String username, String password, String Project, String hostname, int port, boolean isSecured)

GridClient(String username, String password, String Project, String URL)

info

Cloud Admin will always run the test in the "Default" project. Cloud project provided to grid client is not used. User / Project Admin which is assigned to the single project will always run the test in their single project. Cloud project provided to grid client is not used. User / Project Admin which is assigned to several projects - must provide cloud project for login. The test will run in the selected project.

Then use the grid client created to request a device to run your test on with the following command:

Client lockDeviceForExecution(String testName, String deviceXpathQuery, int reservetionTime, long timeout)

The method can be used with additional parameter releaseDevice

Client lockDeviceForExecution(String testName, String deviceXpathQuery, boolean releaseDevice, int reservetionTime, long timeout, boolean onlyAvailable)

When releseDevice = true:

  • The device is released at the end of the test
  • The default value is 'true'

When releseDevice = false:

  • keeps the reservation

In case the device is already reserved or uses future reservations when the test starts then releaseDevice capability will not have any effect and the device will not be released. 

When onlyAvailable=true:

  • Use only available devices.
  • If the method without onlyAvailable parameter is used, the default used is: onlyAvailable=false

When onlyAvailable=false:

  • Use devices in the following priority: STAW, manual, reserved, available.