Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions sample_session_details_API.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@ const clientPlaywrightVersion = cp.execSync('npx playwright --version').toString
* You can use all these details after your test has completed, to fetch logs or use any other Automate REST APIs
*/
const resp = await JSON.parse(await page.evaluate(_ => {}, `browserstack_executor: ${JSON.stringify({action: 'getSessionDetails'})}`));
const jsonObj = await JSON.parse(resp);
console.log(jsonObj.hashed_id); // This gives the session ID of the running session
console.log(jsonObj); // This prints the entire JSON response. You can use any/all of the response attributes the way you like.
console.log(resp.hashed_id); // This gives the session ID of the running session
console.log(resp); // This prints the entire JSON response. You can use any/all of the response attributes the way you like.

await browser.close();
})();