Skip to content

Getting error during Legacy Integration my tests #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jackshavryhin opened this issue Mar 12, 2024 · 2 comments
Open

Getting error during Legacy Integration my tests #20

jackshavryhin opened this issue Mar 12, 2024 · 2 comments

Comments

@jackshavryhin
Copy link

jackshavryhin commented Mar 12, 2024

Screenshot from 2024-03-12 09-54-26
When i trying "Legacy Integration" with my tests wrote on "NodeJS/Playwright", when i trying connect via wssEndpoint getting such issue "Error: browserType.connect: Target page, context or browser has been closed".

test('Authentication Test', async ({}) => {
    const caps = {
        osVersion: "13.0",
        deviceName: "Samsung Galaxy S23", // "Samsung Galaxy S22 Ultra", "Google Pixel 7 Pro", "OnePlus 9", etc.
        browserName: "chrome",
        realMobile: "true",
        name: "My android playwright test",
        build: "playwright-build-1",
        "browserstack.username":  "userName",
        "browserstack.accessKey": "password",
        "browserstack.local":  true,
    }
  let vBrowser = await playwright.chromium.connect({
        wsEndpoint:
            `wss://cdp.browserstack.com/playwright?caps=` +
            `${encodeURIComponent(JSON.stringify(caps))}`,
    });

    let vContext = await vBrowser.newContext();

    const page = await vContext.newPage();

    await test.step("Login Test", async () => {
        await Login(page, config);
    })
@Rokandor
Copy link

Rokandor commented Apr 9, 2024

I am also facing this issue
Error:Target page, context or browser has been closed
And it happens randomly as well without more details

@Schmidt-N
Copy link

I had the same problem, but was able to reconstruct it, I had used the 'BuildTag' which is also allowed in the documentation(https://www.browserstack.com/docs/automate/playwright/organize-tests). However, after including it, it caused exactly this error. Therefore I think that this error always appears when the configurations of the tests do not fit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants