1

In Selenium for Java I can call RemoteWebDriver.getSessionId() to get the GUID associated with my browser session.

How can I get the session ID in Playwright?

I've looked at the members of any seemingly relevant object (Browser, Page, Context, etc.) and I've searched, and I can't find anything.

Maybe there isn't a session ID, but I feel like there must be because our browser host for automation associates Playwright browser sessions with a GUID just like it does for Selenium browser sessions.

Ryan Lundy
  • 204,559
  • 37
  • 180
  • 211
  • what is the use case where you want to reuse the GUID? I don't think there is such an option to retrieve it, but maybe there is an already existing functionality that would provide a solution for your original problem. – theDavidBarton Sep 14 '21 at 12:23
  • I'm using Element34's Selenium Box for testing, and I want to call their API to update sessions as pass or fail based on test results. To do that, I need to pass in a session ID, which at least for Selenium is a GUID. Selenium Box shows GUIDs for Playwright tests too, so those must come from somewhere. – Ryan Lundy Sep 14 '21 at 13:34

0 Answers0