我正在使用Netbeans作为我的IDE和Yii Framework学习Selenium。
当我尝试运行我的测试文件时,它显示以下错误:
Invalid response while accessing the Selenium Server at 'http://localhost:4444/selenium-server/driver/': Failed to start new browser session: org.openqa.selenium.server.RemoteCommandException: Error while launching browser
/srv/http/yii-1.1.14/test/CWebTestCase.php:64
这是我的配置文件:
bootstrap.php中
<?php
// change the following paths if necessary
$yiit=dirname(__FILE__).'/../../../yii-1.1.14/yiit.php';
$config=dirname(__FILE__).'/../config/test.php';
require_once($yiit);
require_once(dirname(__FILE__).'/WebTestCase.php');
Yii::createWebApplication($config);
phpunit.xml :
<phpunit bootstrap="bootstrap.php"
colors="false"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
stopOnFailure="false">
<selenium>
<browser name="Firefox" browser="*firefox /usr/bin/firefox" />
</selenium>
</phpunit>
WebTestCase.php
<?php
/**
* Change the following URL based on your server configuration
* Make sure the URL ends with a slash so that we can use relative URLs in test cases
*/
define('TEST_BASE_URL','http://photogallery.lan/index-test.php/');
/**
* The base class for functional test cases.
* In this class, we set the base URL for the test application.
* We also provide some common methods to be used by concrete test classes.
*/
class WebTestCase extends CWebTestCase
{
/**
* Sets up before each test method runs.
* This mainly sets the base URL for the test application.
*/
protected function setUp()
{
parent::setUp();
$this->setBrowserUrl(TEST_BASE_URL);
}
}
我的独立Selenium Server版本是2.39,请指导我,谢谢。