Sworoop Mahapatra
Sworoop Mahapatra

Reputation: 133

Blank Firefox Window Issue in Selenium PHPUnit Test in Linux Mint

I was trying to test out a page of mine using Selenium and phpunit. I had coded it properly and tried it out on a Ubuntu 14.04 machine. It tested out properly. However I do not remember the version of selenium server and firefox used. Now after some issues, I had removed Ubuntu and intalled Mint on my system. While testing the page, I get a lot of error messages and a blank firefox screen. Current version of firefox is 30 and Selenium 2.4.2 Tried with firefox versions 25,26,27,30. I have posted the codes below. Any help will be appreciated.

Output of Selenium starting

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

Output of Running a PHPUnit Test

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

During this I get a blank firefox window which I have to manually close.

Upvotes: 0

Views: 484

Answers (1)

Sworoop Mahapatra
Sworoop Mahapatra

Reputation: 133

Solved it after reinstalling PHPUnit using composer instead of apt.

Thanks everyone :)

Upvotes: 2

Related Questions