Rayrun
← Back to Discord Forum

Enable Browserstack Test Observability Flag via Browser Capabilities

Hi I have an existing Cucumber Test Runner + Playwright Integrated JS framework where i use this capability to initiate a BrowserStack service. This works fine with Browserstack Automate but it doesn't trigger the Browserstack Test Observability

const caps = {
    os: "Windows",
    osVersion: "10",
    browserName: "edge",
    browserVersion: "latest",
    name: "NAT",
    build: "User Management",
    buildIdentifier: '#${BUILD_NUMBER}',
    "testObservability": true,
    "browserstack.username": process.env.BROWSERSTACK_USERNAME,
    "browserstack.accessKey": process.env.BROWSERSTACK_ACCESS_KEY,
    "browserstack.local": process.env.BROWSERSTACK_LOCAL || true,
  };

bsLocal.start({ key: BS_LOCAL_ARGS } => {// some stuff})

const endpoint = `wss://cdp.browserstack.com/playwright?caps=` +
    `${encodeURIComponent(JSON.stringify(caps))}`;

browser: ChromiumBrowser = await chromium.connect({
  wsEndpoint: endpoint
})

// And perform Cucumber hooks and execution

This thread is trying to answer question "What is the correct capability key to trigger Test Observability in BrowserStack?"

2 replies

Code above works 100% fine. It's just I wanted to enable the Test Observability flag.

I'm not sure if i'm using the correct capability to trigger Test Observability I have tried the ff: keys to no avail

"test_observability": true,
"observability": true,
"testObservability": true,
"browserstack.testObservability": true,
"browserstack.test_observability": true,

Have done too many combinations 🤭 Hoping someone has some idea what's the correct capability key 😄

thank you!

Related Discord Threads

TwitterGitHubLinkedIn
AboutQuestionsDiscord ForumBrowser ExtensionTagsQA Jobs

Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email [email protected].