Xvfb或Firefox抛出错误并免费记录


9

根据该问题的答案,我正在运行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)我该如何清理?(在我看来,实际上,其中大多数是关于'allocs'的某种详细的日志记录信息,我想将其关闭-然后那些“预期的keyym”消息就是抛出异常。)


2
我不认为这是错误。我认为这只是X服务器的闲聊。您也可以通过在命令中的“&”之前添加“ 2> / dev / null”,将这些消息发送到/ dev / null。
cjc 2012年

Answers:


6

我不认为这是错误。

只是X服务器处于闲聊状态。

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

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.