If you have been testing your applications, whether it is web or mobile, you might have noticed that Sauce Labs supplies its customers with a lot of information in the METADATA of each test that has been ran on the platform.
For Web tests, and for that matter for Virtual Cloud Tests (which include native applications as well as hybrid web apps), customers have access to the sessionId, which allows them to get access to the test, which could be shared with other members of the team. It could be done directly from the code by the driver.sessionId() method. This works like magic, but when it comes to tests run with RDC (Real Device Cloud), a customer might see a little extra information, and the session id that they see will actually be Appium Session ID, which is an artifact leftover after Test Object Legacy Platform and Sauce Labs Unified Platform joined forces and became one.
Example of an iOS Simulator Test METADATA:
Example of a Web Test METADATA:
Real Device Test METADATA:
This Appium Session ID, is not the same thing as the session ID used for Web tests and Virtual cloud tests. What a customer would want to use instead would be a Job Id. It is possible during an automated session to get this session information from the driver instance. The driver capabilities will include not only the Appium Session Id & Job ID together, but also a fully formed URL for the test results.
Example in Java:
Call driver.getCapabilities();
In the response you will find the Job ID returned as appium:jobUuid
You will also find the fully formed URL returned as appium:testobject_test_report_url
There is also the ability to get RDC jobs through the REST API, however as these use Job ID, you would need to recurse through all the results looking for the matching Appium session ID: https://docs.saucelabs.com/dev/api/rdc/