---
title: Get Session Details with Playwright | TestingBot
description: Documentation on how to retrieve the Playwright Session Details during
  your tests
source_url:
  html: https://testingbot.com/support/web-automate/playwright/get-session-details
  md: https://testingbot.com/support/web-automate/playwright/get-session-details/index.md
---
# Get Playwright Session Details

When a Playwright test runs on TestingBot, it will generate various artifacts such as logs, video, screenshots and other files.   
 TestingBot will save these files for later retrieval, through our member dashboard or our [REST API](https://testingbot.com/support/api).

To fetch these details through our REST API, you will need to know the unique identifier for each test.   
 TestingBot provides a `testingbot_executor` which you can use to retrieve the `sessionId`, to use in your REST API calls.

## Fetch the sessionId

To fetch the sessionId in your Playwright script, you can fetch the `sessionId` from the `getSessionDetails` method.

See the example below, where we run a Playwright script, fetch the `getSessionDetails` at the end and update the test status via the TestingBot REST API.

    const TestingBot = require('testingbot-api');
    const tb = new TestingBot({
        api_key: 'api_key',
        api_secret: 'api_secret'
    })
    
    const playwright = require('playwright-core');
    
    (async () => {
        const browser = await playwright.chromium.connect({
          wsEndpoint: 'wss://cloud.testingbot.com/playwright?key=api_key&secret=api_secret&browserName=chrome&browserVersion=latest&platform=WIN10'
        })
    
        const context = await browser.newContext()
        const page = await context.newPage()
        await page.goto('https://testingbot.com')
        const testingBotResponse = await page.evaluate(_ => {}, `testingbot_executor: ${JSON.stringify({action: 'getSessionDetails'})}`)
    
        const sessionId = testingBotResponse.sessionId
        const testData = { "test[success]" : "1", "test[status_message]" : "test" };
        await new Promise((resolve) => tb.updateTest(testData, sessionId, function(error, testDetails) { resolve(testDetails) }))
    
        await browser.close()
    })()

Was this page helpful? Yes No 

## Looking for More Help?

Have questions or need more information?   
 You can reach us via the following channels:

- [Email us](https://testingbot.com/contact/new)
- [Join our Slack Channel](https://join.slack.com/t/testingb0t/shared_invite/zt-3bcw9xch-jk19~6XPs_xBrsAgAedkCw)
