Skip to main content

Python Grid Client

Examples - Python Grid Execution For SeeTest

SeeTest Python Client - Using Grid Execution

import grid_client


grid = grid_client.GridClient.new_client_url("cloudUsername", "cloudPassword", "cloudProject", "https://cloud.experitest.com")
client = grid.lockDeviceForExecution('testname', "@os='android'", 60, 20000)
.
.
.
client.releaseClient()

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

GridClient.new_client(userName, password, projectName, domain, port, isSecured)
GridClient.new_client_access_key(accessKey, domain, port, isSecured)
GridClient.new_client_url(userName, password, projectName, url)
GridClient.new_client_url_access_key(accessKey, url)

Parameters

  • userName: Name of cloud user with which to execute the test

  • password: Password of cloud user with which to execute the test

  • projectName: Name of the project to use

  • accessKey:  See more in Use Access Keys for Authentication.

  • domain: The hostname or the IP-address of the cloud server

  • port: The port listened by the cloud server

  • isSecured: Is secure connection the o cloud server

  • url: URL of cloud user with which to execute the test

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

Client lockDeviceForExecution(String testName, String deviceQuery, int reservetionTimeInMinutes, long timeout)

Parameters

  • testName: Name of the test to be shown in Cloud UI and Report

  • deviceQuery: XPath  Search query to look up devices for test execution. More info can be found in the documentation.

  • reservationTimeInMinutes: Name of the test to be shown in Cloud UI and Report

  • timeout: Timeout in milliseconds to wait for an available device according to the search query.

info

Python requirements: Python version 3.x. packages: requests