Page tree
Skip to end of metadata
Go to start of metadata

Last updated: Aug 16, 2020 15:17

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

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. 


On this page:

Step-by-step instructions

Watch the following video to see how to copy a session ID and include it in a script.

To share the session ID:

  1. In the Perfecto Lab, click OPEN NEW WEB SESSION.

  2. In the Open new web session form, do the following:

    1. Select the I will use this session to debug my automation script checkbox.

    2. Select your session parameters, including platform, browser, version, resolution, and location.
    3. Click OPEN.
  3. On the session tab, on the session toolbar, click the Copy session ID button  (this button is only available if you selected the checkbox in step 2a).

  4. In the Copy session ID form, below the session ID, click Copy to clipboard.

  5. In the IDE you are using, add the deviceSessionID capability to your script.

    deviceSessionId capability example
    capabilities.setCapability("deviceSessionId", "48402b47-2281-4bc6-9877-f446f81a5dfc");
  6. Run your test. This performs all your test steps on the device in real-time.

Notes:

  • When you use a new device or start a new Perfecto Lab 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.

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.