You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Selenium webdriver ignores virtualdisplay under MacOS #99
I'm running MacOs 15.3.1 with Python 3.9.6 and Quartz. If I execute the following code, the Firefox browser window shows on the normal screen and not in the virtual screen. In general the virtual screen exists as it is listed (ps -ef | grep Xvfb).
import time
from pyvirtualdisplay import Display
from selenium import webdriver
display = Display(visible=0, size=(800, 600))
display.start()
# now Firefox will run in a virtual display.
# you will not see the browser.
browser = webdriver.Firefox()
browser.get('http://www.google.com')
time.sleep(30)
browser.quit()
display.stop()
However, this works fine, The message box is opened in the virutal screen.
from easyprocess import EasyProcess
from pyvirtualdisplay import Display
with Display(backend="xvfb") as disp:
with EasyProcess(["xmessage", "hello"]) as proc:
proc.wait()
changed the title [-]Selenium webdriver ignores virutaldisplay under MacOS[/-][+]Selenium webdriver ignores virtualdisplay under MacOS[/+]on Feb 20, 2025
Activity
[-]Selenium webdriver ignores virutaldisplay under MacOS[/-][+]Selenium webdriver ignores virtualdisplay under MacOS[/+]