Skip to content

page.evaluate: Browser has been closed #21

Description

@bradydowling

When using the code specified in fixtures.js, this line fails with the following error:

page.evaluate: Browser has been closed

I'm running with "@playwright/test": "~1.20.2". As a workaround, I'm making a direct PUT call to BrowserStack as such:

      if (testInfo.status === 'failed') {
        await axios({
          method: 'put',
          url: `https://api.browserstack.com/automate/sessions/${sessionId}.json`,
          data: payloadArguments,
          auth: {
            username: process.env.BROWSERSTACK_USERNAME,
            password: process.env.BROWSERSTACK_ACCESS_KEY
          },
        });
      }
      else {
        await newPage.evaluate(() => {}, `browserstack_executor: ${browserStackCommandPayloadString}`);
      }

Is there something I need to do to prevent the browser from closing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions