Sauce Labs Customer Idea Portal

Submit an idea and make Sauce Labs even better!

Get device make, model, and operating system via API

When using dynamic allocation, would like the ability to obtain the device information that was automatically chosen for the test session

  • Guest
  • Aug 30 2018
  • Already exists
  • Attach files
  • Guest commented
    21 Sep, 2018 02:16pm

    Yes, it is possible in the real device cloud (former testobject):
    https://api.testobject.com/
    You can request all or certain devices via get request. Here an example for terminal:
    curl -X GET --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Authorization: Basic [YOUR_CREDENTIALS] 'https://app.testobject.com:443/api/rest/devices/v1/devices/Asus_Google_Nexus_7_2013_real'

    Cheers Hajo
    (also just a "user" :-))

  • Sergio Neves Barros commented
    6 Sep, 2018 02:04pm

    hi,

    This should already be possible. The web/appium driver will have an update set of desired capabilities after the session is created which has the testobject device name:

    remoteWebDriver.getCapabilities().getCapability("testobject_device");

    With that name, i believe there there is another API to get the device details.

    https://app.testobject.com/api/rest/v2/devices/{deviceId}

    However you will need to be logged in/have a token for that API.

    Hope this helps.

    Sergio (not part of SauceLabs btw).