Skip to content

[BUG] 2 chrome browsers opened when running a test against selenium 4 grid. #22240

Open
@quldude

Description

@quldude

System info

  • Playwright Version: 1.32.1
  • Operating System: Windows 10
  • Browser: Chrome
  • Other info: Selenium 4 grid - hub and 2 nodes in same machine with chromedriver.

Source code

  • I provided exact source code that allows reproducing the issue locally.
const config: PlaywrightTestConfig = {
  testDir: '.',
  /* Maximum time one test can run for. */
  timeout: 3600 * 1000,
  expect: {
    /**
     * Maximum time expect() should wait for the condition to be met.
     * For example in `await expect(locator).toHaveText();`
     */
    timeout: 5 * 1000,
  },
  /* Run tests in files in parallel */
  fullyParallel: true,
  /* Fail the build on CI if you accidentally left test.only in the source code. */
  forbidOnly: !!process.env.CI,
  retries: 1,
  /* Opt out of parallel tests on CI. */
  workers: process.env.CI ? 1 : undefined,
  /* Reporter to use. See https://playwright.dev/docs/test-reporters */
  reporter: [['html'], ['list', { printSteps: true }]],
  globalSetup: require.resolve('./lib/global-setup'),
  /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
  use: {
    /* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */
    actionTimeout: 0,
    /* Base URL to use in actions like `await page.goto('/')`. */
    baseURL: process.env.CI ? process.env.TEST_SERVER_URL : 'http://localhost:3000',

    /* Use data-qa as the default test-id attribute */
    testIdAttribute: 'data-qa',

    /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
    trace: 'on-first-retry',
    screenshot: 'only-on-failure',
    video: 'retain-on-failure',
    headless: false,
    userAgent: `${devices['Desktop Chrome'].userAgent} ${customUserAgentSuffix}`,
    channel: 'chrome',
  },

  /* Folder for test artifacts such as screenshots, videos, traces, etc. */
  outputDir: 'test-results/',
};

Steps

  • Run command:
DEBUG=pw:browser* SELENIUM_REMOTE_URL=http://{hub ip}:4444 PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 npx playwright test specs/tests.spec.ts -g "test name"

Expected

Only 1 chrome browser opened with test site page..

Actual

2 chrome browsers opened. One opens with blank page and the other opens with test site page.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions