Skip to content

--xvfb breaks the --reuse-session / --rs option #3440

Closed
@smanenti

Description

@smanenti

When using the --xvfb option on a Linux environment (without desktop), the option --reuse-session has no effet, and the Chrome browser is re-launched on each tests.

More context:
We're using Pytest/SeleniumBase on a Jenkins environment to run our tests.
Jenkins is running on a Linux OS, without desktop, so we are using the --xvfb option, in addition to the --reuse-session to faster our tests.

We have confirmed that the PID of the Chrome browser is updated between tests, indicating that the Chrome browser instance is restarted.

Steps to reproduce

  1. Write two different tests on a same class:
  2. Test 1 is opening a specific URL
  3. Test 2 is asserting this specific URL (which can only work if --reuse-session is enabled)
  4. Execute the test (on the specified environment) with the option --xvfb + --reuse-session

Expected behavior

  1. Test 2 must pass, as the Chrome is expected to be reused between Test 1 and Test 2

Actual behavior

  1. Test 2 is failing, as the reuse-session is affected by the XVFB option (Chrome browser is relaunched)

Workaround

  1. Replace the --xvfb option with --headless

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUh oh... Something needs to be fixedworkaround existsYou can reach your destination if you do this...

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions