2012-04-25 155 views
2

我有一个运行硒phpunit测试的ant构建脚本。我可以在命令行上运行构建脚本,并且看到测试正在进行,浏览器窗口打开并执行硒测试。 命令行上的所有内容都很好。PHPUnit在命令行上运行硒测试,但不是通过jenkins构建

但是如果我创建jenkins作业来运行构建脚本。 它尝试运行phpunit任务时失败。这是控制台输出。

看来,当詹金斯运行构建它不能访问硒。 请参阅'访问被拒绝''无法显示网页' 任何帮助将不胜感激!

的PHPUnit:

[exec] PHPUnit 3.6.10 by Sebastian Bergmann. 
[exec] 
[exec] The Xdebug extension is not loaded. No code coverage will be generated. 
[exec] 
[exec] 
[exec] E 
[exec] 
[exec] 
[exec] Time: 1 second, Memory: 3.75Mb 
[exec] 
[exec] There was 1 error: 
[exec] 
[exec] 1) Example::testPokerMainNav 
[exec] Issues while capturing the screenshot: 
[exec] Invalid response while accessing the Selenium Server at 'http://localhost:4444/selenium-server/driver/': <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > 
[exec] <HTML> 
[exec]  <HEAD> 
[exec]   <title>Web Page Cannot Be Displayed</title> 
[exec]   <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5"> 
[exec]   <style> 
[exec]   <!-- 
[exec] 
[exec]    body { 
[exec]     font-family: Arial,Sans-serif; 
[exec]    } 
[exec] 
[exec]    li { 
[exec]     padding-top: 5px; 
[exec]    } 
[exec] 
[exec]    .messageBox { 
[exec]     BORDER-TOP: #9c9a9c 1px solid; 
[exec]     BORDER-LEFT: #9c9a9c 1px solid; 
[exec]     BORDER-RIGHT: #9c9a9c 1px solid; 
[exec]     BORDER-BOTTOM: #9c9a9c 1px solid; 
[exec]    } 
[exec] 
[exec]    .alertTitle 
[exec]    { 
[exec]     color: #676767; 
[exec]     FONT-SIZE: 12px; 
[exec]     font-weight: bold; 
[exec]    } 
[exec] 
[exec]    .alertText 
[exec]    { 
[exec]     color: #676767; 
[exec]     FONT-SIZE: 11px; 
[exec]     font-weight: normal; 
[exec]     padding-left: 15px; 
[exec]     padding-right: 15px; 
[exec]    } 
[exec] 
[exec]   --> 
[exec]   </style> 
[exec]  </HEAD> 
[exec]  <body> 
[exec]   <table border="0" width="100%" height="100%" cellpadding="0" cellspacing="0"> 
[exec]    <tr> 
[exec]     <td align="center" valign="center"> 
[exec]      <table> 
[exec]       <tr> 
[exec]        <td> 
[exec]         <table border="0" class="messageBox"> 
[exec]          <tr> 
[exec]           <td height="25">&nbsp;</td> 
[exec]          </tr> 
[exec]          <tr> 
[exec]           <td align="center"> 
[exec]            <table border="0" width="490"> 
[exec]             <tr> 
[exec]              <td class="alertTitle" align="center"> 
[exec]               <strong>Unable to display page</strong> 
[exec]              </td> 
[exec]             </tr> 
[exec]             <tr class="spacerRow"> 
[exec]              <td></td> 
[exec]             </tr> 
[exec]             <tr> 
[exec]              <td class="alertText" align="left"> 
[exec]               It has not been possible to display the page you requested for the following reason: 
[exec]               <ul> 
[exec]                <li>Access Denied</li> 
[exec]               </ul> 
[exec]               Contact your system administrator if you continue to experience difficulties. 
[exec]              </td> 
[exec]             </tr> 
[exec]            </table> 
[exec]           </td> 
[exec]          </tr> 
[exec]          <tr> 
[exec]           <td height="25">&nbsp;</td> 
[exec]          </tr> 
[exec]         </table> 
[exec]        </td> 
[exec]       </tr> 
[exec]       <tr> 
[exec]        <td align="right"><asp:Label id="lblDateTime" runat="server" CssClass="AlertText" /></td> 
[exec]       </tr> 
[exec]      </table> 
[exec]     </td> 
[exec]    </tr> 
[exec]   </table> 
[exec]  </body> 
[exec] </HTML> 
[exec] 
[exec] Invalid response while accessing the Selenium Server at 'http://localhost:4444/selenium-server/driver/': <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > 
[exec] <HTML> 
[exec]  <HEAD> 
[exec]   <title>Web Page Cannot Be Displayed</title> 
[exec]   <meta name="vs_targetSchema" content=" 

构建失败

硒:硒服务器独立-2.21.0.jar。

从Firebug selenium IDE导出的PHPunits测试。

PHPUnit:3.6.10。

+0

只是为了验证:Jenkins是在与硒服务器不同的机器还是在同一台机器上?当你在浏览器中访问'http:// localhost:4444/selenium-server/driver /'时,你会看到什么? – Potherca 2012-09-07 21:05:24

回答

0

我有一个http_proxy在ubuntu中设置环境文件。

由于某种原因,jenkins用户试图通过代理连接到我的网站。 然而,该网站与詹金斯在同一个盒子。因此失败。

我删除了http_proxy,重新启动ubuntu,它的工作。

仍然令人困惑,但它现在工作。

相关问题