2011-01-11 27 views
8

我需要在通過Xvfb無頭模式下運行Selenium測試,在pom.xml我有:Selenium測試用的Xvfb

 <plugin> 
     <groupId>org.codehaus.mojo</groupId> 
     <artifactId>selenium-maven-plugin</artifactId> 
     <version>1.1</version> 

     <executions> 
      <execution> 
       <id>xvfb</id> 
       <phase>pre-integration-test</phase> 
       <goals> 
        <goal>xvfb</goal> 
       </goals> 
       <!-- 
       <configuration> 
        <display>:2</display> 
       </configuration> 
        --> 
      </execution> 

      <execution> 
       <id>selenium</id> 
       <phase>pre-integration-test</phase> 
       <goals> 
        <goal>start-server</goal> 
       </goals> 
       <configuration> 
        <background>true</background> 
       </configuration> 
      </execution> 
     </executions> 
     </plugin> 

當我運行mvn集成測試,它加載失敗Xvfb,硒測試仍然在Firefox中運行,我檢查了以下內容:

(EE) AIGLX error: dlopen of /usr/X11/lib/dri/swrast_dri.so failed (dlopen(/usr/X11/lib/dri/swrast_dri.so, 5): image not found) 
(EE) GLX: could not load software renderer 
(EE) XKB: Couldn't open rules file /usr/X11/share/X11/xkb/rules/base 
(EE) XKB: No components provided for device Virtual core keyboard 

任何人都知道這意味着什麼?謝謝。

回答

6

向您的Xvfb命令行添加-extension GLX可能會刪除前兩個錯誤。

+0

你的意思`+擴展GLX`? – Ben 2014-01-01 15:35:52

4

我發現我的設置中缺少mesa驅動程序。

yum install mesa-dri-drivers 

解決了這個問題。

3

在於Debian/Ubuntu,這個包是 「的libgl1 - 檯面 - DRI」,如:

apt-get install libgl1-mesa-dri