Share a session with an IDE script

For the purpose of script development and debugging, you can open a device in the Perfecto Lab and share that session with your favorite IDE. Session sharing allows you to work interactively on the device in the Perfecto Lab while simultaneously executing an Appium or Selenium script from your IDE. 

Restriction: At this point, session sharing for desktop web is only available for Windows machines.

Limitations

The following limitations apply:

  • When using the deviceSessionId capability with iOS, you cannot use the driver.get() method to navigate to a page. This is an Apple limitation. The following workarounds are available:

    • Use the Perfecto extension mobile:browser:goto.

    • Because session sharing facilitates interaction with the device, navigate to the required page manually.

  • 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);
  • The deviceSessionId capability is currently not supported with Appium 2.

Step-by-step instructions

What kind of session do you want to share? Expand the corresponding steps.

Important: When you use a new device or start a new Perfecto session, you need a new session ID.

If you intend to run your script outside of session sharing, before committing, remove these capabilities from the script code. Otherwise, your script will fail.