如何使 Xvfb 显示可见? [英] How to make Xvfb display visible?
问题描述
我通过 Xvfb 在显示编号 :99 上运行 selenium,如下所示:
I am running selenium through Xvfb on display number :99 like this:
/usr/bin/Xvfb :99 -ac -screen 0 1024x768x8 &导出显示=":99" &&java -jar/usr/lib/selenium/selenium-server-standalone-2.24.1.jar-端口 4444
/usr/bin/Xvfb :99 -ac -screen 0 1024x768x8 & export DISPLAY=":99" && java -jar /usr/lib/selenium/selenium-server-standalone-2.24.1.jar -port 4444
但是,默认情况下,显示的数字不是 :0.如何让它在浏览器中真正看到 selenium 正在做什么?
However display with number other than :0 is not visible by default. How do I make it visible to actually see what selenium is doing in the browser?
推荐答案
它是虚拟的.来自手册页 Xvfb(1)
:
It's virtual. From the man page Xvfb(1)
:
Xvfb 是一个 X 服务器,可以在没有显示硬件和物理输入设备的机器上运行.它使用虚拟内存模拟了一个愚蠢的帧缓冲区.
Xvfb is an X server that can run on machines with no display hardware and no physical input devices. It emulates a dumb framebuffer using virtual memory.
也在手册页中:
Xvfb -pixdepths 3 27 -fbdir/var/tmp
服务器将侦听作为服务器编号 0 的连接,将具有默认屏幕配置(一个屏幕,1280x1024x8),还将支持 3 和 27 的像素图深度,并将使用/var/tmp 中用于帧缓冲区的内存映射文件.
Xvfb -pixdepths 3 27 -fbdir /var/tmp
The server will listen for connections as server number 0, will have the default screen configuration (one screen, 1280x1024x8), will also support pixmap depths of 3 and 27, and will use memory mapped files in /var/tmp for the framebuffer.
xwud -in/var/tmp/Xvfb_screen0
显示由前面的示例启动的服务器的屏幕 0.
xwud -in /var/tmp/Xvfb_screen0
Displays screen 0 of the server started by the preceding example.
这篇关于如何使 Xvfb 显示可见?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!