Skip to content

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

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

Closed
smanenti opened this issue Jan 21, 2025 · 4 comments · Fixed by #3441
Closed

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

smanenti opened this issue Jan 21, 2025 · 4 comments · Fixed by #3441
Labels
bug Uh oh... Something needs to be fixed workaround exists You can reach your destination if you do this...

Comments

@smanenti
Copy link

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
@mdmintz mdmintz added bug Uh oh... Something needs to be fixed workaround exists You can reach your destination if you do this... labels Jan 21, 2025
@mdmintz
Copy link
Member

mdmintz commented Jan 21, 2025

Thanks for reporting this. I'm looking into a possible fix.
Likely caused by stopping and starting Xvfb between tests.
I'll need to figure out a way to keep Xvfb open in the same way as the reused browser.

@mdmintz mdmintz changed the title --xvfb is breaking the --reuse-session option (browser relaunched on each tests) --xvfb breaks the --reuse-session / --rs option Jan 21, 2025
@mdmintz
Copy link
Member

mdmintz commented Jan 21, 2025

This was resolved in 4.34.0 - https://github.com/seleniumbase/SeleniumBase/releases/tag/v4.34.0

@smanenti
Copy link
Author

Thanks for fixing this issue so quickly!

@makifermis
Copy link

Bravo for this remarkable quick reaction @mdmintz, and thank you ! 👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Uh oh... Something needs to be fixed workaround exists You can reach your destination if you do this...
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants