phpunit-selenium
phpunit-selenium copied to clipboard
OR Server Exception: sessionId led to start new browser session: Error while launching browser doesn't exist; perhaps this session was already stopped?
Hi, I don't understand why for every test I run, I get the error message : OR Server Exception: sessionId led to start new browser session: Error while launching browser doesn't exist; perhaps this session was already stopped?
I'm using PHPUnit "PHPUnit 3.6.3 by Sebastian Bergmann." and last PHPUnit Selenium tag (1.2.3)
<?php
require_once __DIR__ . '/../../library/PHPUnit/Extensions/SeleniumTestCase.php';
require_once __DIR__ . '/../../library/PHPUnit/Extensions/SeleniumTestSuite.php';
require_once __DIR__ . '/../../library/PHPUnit/Extensions/SeleniumTestCase/Driver.php';
class PaymentFormTest extends PHPUnit_Extensions_SeleniumTestCase
{
protected $captureScreenshotOnFailure = TRUE;
protected $screenshotUrl = 'http://pc-dev-integ1.company.com/screenshots';
protected $screenshotPath = '/home/user/screenshots';
protected $coverageScriptUrl = null;
public static $browsers = array
(
array
(
'name' => 'Firefox on Linux',
'browser' => '*firefox3 /usr/lib/iceweasel/firefox-bin',
'host' => 'pc-dev-integ1.company.com',
'port' => 4444,
)
);
public function setUp()
{
$formUrl = 'http://pc-dev-integ1.company.com/users/create.php';
$this->setBrowserUrl($formUrl);
parent::setUp();
}
}
Do you know what can lead to this error message and how to correct it ?
Take a look at the linked commit for a correct usage of setBrowserUrl(); if you run into issues with your more detailed configuration, please report a new failing test case.
I just updated the code from my first post and added the setUp method (with the call of setBrowserUrl). I think I correctly used the setBrowserUrl method.
Do you know at least what does this error appear ? The message is not so clear...
You should try changing your browser configuration: it's the only peculiar thing to check. Host and port are correct since this error is generated by the Selenium Server (it can be reached).
I have the same problem after upgrade to 1.2.3 I set browsers in phpunit.xml. When downgrade to version 1.2.3 - it's all ok.
Please state the two versions - upgrading and downgrading to 1.2.3 is the same thing.
I had the same problem upgrading from 1.2.1 to 1.2.4. When running the test suite all tests are marked as skipped "S" instantaneously. The browser is set to "*firefox" in my xml config file along with which tests ro run.
In the selenium log I get the following:
INFO - Got result: ERROR Server Exception: sessionId led to start new browser session: Browser not supported: (Did you forget to add a *?)
Supported browsers include: *firefox *mock *firefoxproxy *pifirefox *chrome *iexploreproxy *iexplore *firefox3 *safariproxy *googlechrome *konqueror *firefox2 *safari *piiexplore *firefoxchrome *opera *iehta *custom doesn't exist; perhaps this session was already stopped? on session led to start new browser session: Browser not supported: (Did you forget to add a *?)
in my xml config file i have the following:
<phpunit>
<logging>
<log type="junit" target="junit.xml" />
</logging>
<selenium>
<browser name="Firefox on localhost"
browser="*firefox"
host="localhost"
port="4444"
timeout="90"/>
</selenium>
<testsuites>
<testsuite name="Browser_Tests">
<file>Tests/MyTest.php</file>
</testsuite>
</testsuites>
</phpunit>
This works fine with version 1.2.1 but not in 1.2.4