Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.4.4

Bug #15896 Testing_Selenium with Grid passes sessionId as empty
Submitted: 2009-02-13 10:22 UTC
From: anay Assigned: kguest
Status: Closed Package: Testing_Selenium
PHP Version: 5.2.5 OS: Ubuntu
Roadmaps: (Not assigned)    
Subscription  


 [2009-02-13 10:22 UTC] anay (Anay Nayak)
Description: ------------ I have been trying to setup a PHP test suite on selenium grid using the Testing_Selenium module(http://pear.php.net/package/Testing_Selenium). The steps followed to set up the environment are similar to the ones mentioned at http://seleniumhq.org/projects/remote-control/languages/php.html When the sample test GoogleTest.php is run using "phpunit GoogleTest.php" it fails with an error on the selenium-rc console. Note: The selenium hub and remote control have been launched separately in different terminal instances. [java] INFO: Processing '1 => "/", cmd => "open", sessionId => ""' [java] 2009-02-12 11:26:06.147::WARN: /selenium-server/driver/: [java] java.lang.NullPointerException [java] at com.thoughtworks.selenium.grid.hub.remotecontrol.commands.Selenese Command.execute(SeleneseCommand.java:38) [java] at com.thoughtworks.selenium.grid.hub.HubServlet.forward(HubServlet.jav a:52) [java] at com.thoughtworks.selenium.grid.hub.HubServlet.process(HubServlet.jav a:41) [java] at com.thoughtworks.selenium.grid.hub.HubServlet.doGet(HubServlet.java: 26) The interesting thing to notice here is that the sessionId is blank. Commenting out the following line in the Testing_Selenium module solves the problem and the test completes successfully. Testing/Selenium.php(line 2562) # stream_set_blocking($handle, false); It seems that the stream was set to be non-blocking and hence was not able to pick up the session id from the selenium-rc web response for the getNewBrowserSession request. Now I am not too sure if that is the correct "fix" as running the test with only the selenium-server(without grid) runs at a very slow pace. If the line is uncommented and run with selenium-server(without grid) it runs fast and passes. Problem reproducible on : OS: Ubuntu 8.10 PHP: PHP 5.2.6-2ubuntu4 with Suhosin-Patch 0.9.6.2 (cli) PHPUnit: PHPUnit 3.3.14 Testing_Selenium: 0.4.3 (beta) Selenium-grid : 1.0.3 Also posted at http://clearspace.openqa.org/message/56570 Test script: --------------- Expected result: ---------------- Actual result: --------------

Comments

 [2009-07-30 19:35 UTC] crs (Kris Kros)
Find line: stream_set_blocking($handle, false); in file Selenium.php and change value "false" to "true". Now it should work properly with Selenium Grid
 [2010-04-10 04:26 UTC] kguest (Ken Guest)
-Assigned To: +Assigned To: kguest
 [2010-04-10 04:26 UTC] kguest (Ken Guest)
-Status: Assigned +Status: Closed
This bug has been fixed in SVN. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.