Windows 上的 Xvfb [英] Xvfb on Windows

查看:140
本文介绍了Windows 上的 Xvfb的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 pyvirtualdisplay 通过无头 Firefox 浏览器运行测试.这是我正在使用的代码:

I'm using pyvirtualdisplay to run a test with a headless Firefox browser. This is the code I'm using :

from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from pyvirtualdisplay import Display

display= Display(visible=0, size=(320, 240)).start()  # visible=0
display.start()
driver = webdriver.Firefox()
driver.get("https://google.com")

display.quit()

以及我获得的回溯:

easyprocess.EasyProcessCheckInstalledError: cmd=['Xvfb','-help']

推荐答案

您不能在 Windows 上使用 pyvirtualdisplay.

You can't use pyvirtualdisplay on Windows.

它只是一个调用 Xvfb 的包装器.Xvfb 是 X Window 系统的无头显示服务器.Windows 不使用 X Window 系统.

It is just a wrapper that calls Xvfb. Xvfb is a headless display server for the X Window System. Windows does not use the X Window System.

这篇关于Windows 上的 Xvfb的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆