Reputation: 714
I use selenium 2 with Phpunit. when I run a script I got this error during the run. PHPUnit_Extensions_Selenium2TestCase_NoSeleniumException: Error connection[28] to localhost:4444/wd/hub/session/edf323b4-c6ba-471a-9966-f2b9f3718084/url: Operation timed out after 60000 milliseconds with 0 bytes received
sometimes after several seconds and sometimes after 20+ minutes (memory: 48Mb ). it takes a lot of time to execute the script. ( it go over like 100 news in different pages ) but I don't believe that it is a problem ( sometimes it crush after seconds ). I already tried update the selenium and phpunit framework to last version but it doesn't helps.
Is there any option to continue the script after the connection crush? or avoid the crush?
I know that I can try to increase connection time, but I look for a different solution or explanation why it happens. any ideas?
thanks.
Upvotes: 2
Views: 1096
Reputation: 2092
I had the same issue and after days trying everything(I tried the solutions in this question too) without success to solve this issue, I decided to change the browser.
I downloaded the Chrome Driver and everything started to work without any problem. Which leads me to believe that can be some version conflict or something else. I used Selenium version 2.53.0 and PhantomJS version 2.1.1.
Upvotes: 1
Reputation: 3653
I encountered the same problem.
It was caused by accessing to sessions and using session_id()
. You should use session_write_close()
to fix the issue.
Upvotes: 0
Reputation: 714
the problems with connection is because the CURL, I tried to change the php.ini and increase the timeout but it not works so I understand that probably selenium set the timeout on the fly or something. after a short grep I found this file:
phpunit/phpunit-selenium/PHPUnit/Extensions/Selenium2TestCase/Driver.php
in the construct method it possible to change the default of the 'timeout' variable. to make sure that this parameter never changed ( if you lazy to find all the places where selenium calls to this class ) set your default timeout to the 'seleniumServerRequestsTimeout' property ( not recommended ).
Upvotes: 1