Skip to content

Commit 408f1f7

Browse files
sourav-kundufrancisf
authored andcommitted
update code snippet for getSessionDetails executor
1 parent ec2042f commit 408f1f7

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

sample_session_details_API.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,8 @@ const expect = require('chai').expect;
4141
* You can use all these details after your test has completed, to fetch logs or use any other Automate REST APIs
4242
*/
4343
const resp = await JSON.parse(await page.evaluate(_ => {}, `browserstack_executor: ${JSON.stringify({action: 'getSessionDetails'})}`));
44-
const jsonObj = await JSON.parse(resp);
45-
console.log(jsonObj.hashed_id); // This gives the session ID of the running session
46-
console.log(jsonObj); // This prints the entire JSON response. You can use any/all of the response attributes the way you like.
44+
console.log(resp.hashed_id); // This gives the session ID of the running session
45+
console.log(resp); // This prints the entire JSON response. You can use any/all of the response attributes the way you like.
4746

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

0 commit comments

Comments
 (0)