Xvfb 或 Firefox 抛出错误并无偿记录

Xvfb 或 Firefox 抛出错误并无偿记录

根据答案这个问题,我正在运行 Xvfb 来制作虚拟显示,以便 Firefox 将在我的 CentOS 服务器上运行。 (我不需要看到 firefox 或使用 firefox 执行任何实际的键或屏幕输入/输出 - 它只需要运行,以便 Selenium 可以驱动它。)我试图弄清楚为什么 Xvfb (或 firefox)会抛出异常一堆错误。

我使用以下命令启动 Xvfb:

Xvfb :1 -screen 0 1024x768x24 &

在我启动它之后,屏幕上会立即回显一些错误消息(奇怪的是,它们出现在 shell 提示符之后):

[root@host /home/lm/cron]# Xvfb :1 -screen 0 1024x768x24 &               
[1] 9214
[root@host /home/lm/cron]# expected keysym, got XF86TouchpadOn: line 120 of inet
expected keysym, got XF86TouchpadOff: line 121 of inet

当我运行 Selenium 测试脚本时,Selenium 日志中会出现更多错误:

5 XSELINUXs still allocated at reset
SCREEN: 0 objects of 176 bytes = 0 total bytes 0 private allocs
DEVICE: 4 objects of 48 bytes = 192 total bytes 0 private allocs
CLIENT: 0 objects of 144 bytes = 0 total bytes 0 private allocs
WINDOW: 0 objects of 48 bytes = 0 total bytes 0 private allocs
PIXMAP: 1 objects of 16 bytes = 16 total bytes 0 private allocs
GC: 0 objects of 56 bytes = 0 total bytes 0 private allocs
CURSOR: 0 objects of 8 bytes = 0 total bytes 0 private allocs
CURSOR_BITS: 0 objects of 8 bytes = 0 total bytes 0 private allocs
DBE_WINDOW: 0 objects of 24 bytes = 0 total bytes 0 private allocs
TOTAL: 5 objects, 208 bytes, 0 allocs
4 DEVICEs still allocated at reset
DEVICE: 4 objects of 48 bytes = 192 total bytes 0 private allocs
CLIENT: 0 objects of 144 bytes = 0 total bytes 0 private allocs
WINDOW: 0 objects of 48 bytes = 0 total bytes 0 private allocs
PIXMAP: 1 objects of 16 bytes = 16 total bytes 0 private allocs
GC: 0 objects of 56 bytes = 0 total bytes 0 private allocs
CURSOR: 0 objects of 8 bytes = 0 total bytes 0 private allocs
CURSOR_BITS: 0 objects of 8 bytes = 0 total bytes 0 private allocs
DBE_WINDOW: 0 objects of 24 bytes = 0 total bytes 0 private allocs
TOTAL: 5 objects, 208 bytes, 0 allocs
1 PIXMAPs still allocated at reset
PIXMAP: 1 objects of 16 bytes = 16 total bytes 0 private allocs
GC: 0 objects of 56 bytes = 0 total bytes 0 private allocs
CURSOR: 0 objects of 8 bytes = 0 total bytes 0 private allocs
CURSOR_BITS: 0 objects of 8 bytes = 0 total bytes 0 private allocs
DBE_WINDOW: 0 objects of 24 bytes = 0 total bytes 0 private allocs
TOTAL: 1 objects, 16 bytes, 0 allocs
14:33:47.919 INFO - Done: /session/1330284794945
expected keysym, got XF86TouchpadOn: line 120 of inet
expected keysym, got XF86TouchpadOff: line 121 of inet

现在,有趣的部分是,尽管所有这些混乱,一切都正常:Selenium 正在与 firefox 属性对话,firefox 正在做它应该做的事情并将其传递回 Selenium 等等。我只是想知道是否(a)我应该担心所有这些消息/错误,以及 (b) 我该如何清理它? (实际上在我看来,其中大部分是关于“分配”的某种详细日志信息——我想关闭它——然后那些“预期的键符”消息被抛出异常。)

答案1

我不认为它们有错误。

只是 X 服务器在闲聊。

您也可以通过使用启动 Xvfb 将这些消息发送到 /dev/nullXvfb :1 -screen 0 1024x768x24 2>/dev/null &

相关内容