phpunit-selenium icon indicating copy to clipboard operation
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?

Open benjamin-rtblw opened this issue 13 years ago • 9 comments

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();
    }
  }

benjamin-rtblw avatar Feb 20 '12 09:02 benjamin-rtblw

Do you know what can lead to this error message and how to correct it ?

benjamin-rtblw avatar Feb 20 '12 12:02 benjamin-rtblw

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.

giorgiosironi avatar Feb 20 '12 17:02 giorgiosironi

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.

benjamin-rtblw avatar Feb 21 '12 08:02 benjamin-rtblw

Do you know at least what does this error appear ? The message is not so clear...

benjamin-rtblw avatar Feb 22 '12 08:02 benjamin-rtblw

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).

giorgiosironi avatar Feb 22 '12 10:02 giorgiosironi

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.

stamm avatar Mar 12 '12 14:03 stamm

Please state the two versions - upgrading and downgrading to 1.2.3 is the same thing.

giorgiosironi avatar Mar 12 '12 15:03 giorgiosironi

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 *?)

briantully avatar Mar 12 '12 17:03 briantully

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

briantully avatar Mar 12 '12 17:03 briantully