Legacy | Session sharing: session ID (Flash UI)

 This feature is no longer officially supported in the Flash UI.

We have simplified the work process with your IDE and the Perfecto Lab in parallel when developing Appium/Selenium scripts. No additional add-ons/plugins are required anymore. Session sharing allows you to work interactively on the device in the Perfecto lab while executing an Appium/Selenium script simultaneously from your favorite IDE. 

Now, you can open a device in the Perfecto lab and then share that session with your IDE . This is intended for script development or debugging.

Limitations

When the deviceSessionId capability is used along with other capabilities, the only capability that takes effect is deviceSessionId. Other capabilities (such as install app or open app) are ignored. You can use the Perfecto driver.executeScript to code these and other actions (for more information, see Execute proprietary functions). For example, if you want to install an application as part of the shared session, you can use the following code: 

Copy
//declare the Map for script parameters
Map<String, Object> params = new HashMap<>();
  params.put("file", "PRIVATE:applications/Errands.ipa");
params.put("instrument", "noinstrument");
driver.executeScript("mobile:application:install", params);

Step-by-step instructions

  1. Open a Perfecto lab and open a device
  2. Click the "More" link and select "Session ID"

  3. Copy the session ID or the capability code sample to the clipboard

  4. Add the capability to your script in the IDE you are using

  5. Now you can interact with the same device session with both the IDE script and the Perfecto lab

  6. A New session ID is needed when a new Perfecto Lab session is started or when using a new device

Copy

Session ID example

B8DA4E1494C08BA5A4AFB8B5E7D8729A
Copy

deviceSessionId capability example

capabilities.setCapability("deviceSessionId", "B8DA4E1494C08BA5A4AFB8B5E7D8729A");

Don't forget to remove this capability from the script code before committing. Otherwise your script will fail

This feature will work only if you have one device opened in the Perfectolab. If you have two or more devices you must specify in your test the device id you want (same as you would do if running a test on a device, without it being open in the Perfecto Lab).

  • Set Perfecto's MCM logs in Debug mode | Troubleshooting