Linux Mint中的Selenium PHPUnit测试中的空白Firefox窗口问题

时间:2014-06-25 10:16:54

标签: linux firefox selenium phpunit mint

我试图用Selenium和phpunit测试我的一个页面。我已经正确编码并在Ubuntu 14.04机器上试用了它。它测试得当。 但是我不记得selenium服务器和firefox使用的版本。 现在经过一些问题,我已经删除了Ubuntu并在我的系统上安装了Mint。 在测试页面时,我收到了很多错误消息和一个空白的firefox屏幕。 当前版本的firefox是30和Selenium 2.4.2 尝试使用firefox版本25,26,27,30。 我已经发布了以下代码。 任何帮助将不胜感激。

硒的输出

java -jar selenium-server-standalone-2.42.2.jar25 Jun, 2014 3:36:17 PM org.openqa.grid.selenium.GridLauncher main
INFO: Launching a standalone server
15:36:17.264 INFO - Java: Sun Microsystems Inc. 20.45-b01
15:36:17.264 INFO - OS: Linux 3.13.0-24-generic amd64
15:36:17.280 INFO - v2.42.2, with Core v2.42.2. Built from revision 6a6995d
15:36:17.347 INFO - Default driver org.openqa.selenium.ie.InternetExplorerDriver     registration is skipped: registration capabilities Capabilities [{platform=WINDOWS,     ensureCleanSession=true, browserName=internet explorer, version=}] does not match with    current platform: LINUX
15:36:17.398 INFO - RemoteWebDriver instances should connect to:    http://127.0.0.1:4444/wd/hub
15:36:17.399 INFO - Version Jetty/5.1.x
15:36:17.400 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
15:36:17.401 INFO - Started HttpContext[/selenium-server,/selenium-server]
15:36:17.401 INFO - Started HttpContext[/,/]
15:36:17.419 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler@a39ab89
15:36:17.419 INFO - Started HttpContext[/wd,/wd]
15:36:17.422 INFO - Started SocketListener on 0.0.0.0:4444
15:36:17.422 INFO - Started org.openqa.jetty.jetty.Server@5abb7465

运行PHPUnit测试的输出

phpunit testBooking.php
PHPUnit 3.7.28 by Sebastian Bergmann.

E

Time: 5.24 seconds, Memory: 3.00Mb

There was 1 error:

1) TestBookingBlockDate::testBlock
RuntimeException: POST /session/url
Build info: version: '2.42.2', revision: '6a6995d', time: '2014-06-03 17:42:03'
System info: host: 'Sworoop', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64',    os.version: '3.13.0-24-generic', java.version: '1.6.0_45'
Driver info: driver.version: unknown

/var/www/Folder/UnitTests/TurningStone/testBooking.php:13
/var/www/Folder/UnitTests/TurningStone/testBooking.php:13

FAILURES!
Tests: 1, Assertions: 1, Errors: 1.
PHP Fatal error:  Uncaught exception 'RuntimeException' with message 'DELETE /session
Build info: version: '2.42.2', revision: '6a6995d', time: '2014-06-03 17:42:03'
System info: host: 'Sworoop', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64',    os.version: '3.13.0-24-generic', java.version: '1.6.0_45'
Driver info: driver.version: unknown' in    /usr/share/php/PHPUnit/Extensions/Selenium2TestCase/Driver.php:127
Stack trace:
#0 /usr/share/php/PHPUnit/Extensions/Selenium2TestCase/Session.php(137):      PHPUnit_Extensions_Selenium2TestCase_Driver->curl('DELETE',    Object(PHPUnit_Extensions_Selenium2TestCase_URL))
#1 /usr/share/php/PHPUnit/Extensions/Selenium2TestCase/Session.php(117):      PHPUnit_Extensions_Selenium2TestCase_Session->stop()
#2 [internal function]: PHPUnit_Extensions_Selenium2TestCase_Session->__destruct()
#3 {main}
  thrown in /usr/share/php/PHPUnit/Extensions/Selenium2TestCase/Driver.php on line 127
PHP Stack trace:
PHP   1. {main}() /usr/bin/phpunit:0
PHP   2. PHPUnit_TextUI_Command::main() /usr/bin/phpunit:46
PHP   3. PHPUnit_TextUI_Command->run() /usr/share/php/PHPUnit/TextUI/Command.php:129

在此期间,我得到一个空白的firefox窗口,我必须手动关闭。

1 个答案:

答案 0 :(得分:2)

使用composer而不是apt重新安装PHPUnit后解决了这个问题。

谢谢大家:)