2012-05-16 61 views
2

当我运行,即使进行了抽样检测,无论是在Netbeans的命令行的IDE,比如:PHPUnit的Selenium2 - 没有浏览器实例

class WebTest extends PHPUnit_Extensions_Selenium2TestCase 
{ 
protected function setUp() 
{ 
    $this->setBrowser('firefox'); 
    $this->setBrowserUrl('http://www.example.com/'); 
} 

public function testTitle() 
{ 
    $this->url('http://www.example.com/'); 
    $this->assertEquals('Example WWW Page', $this->title()); 
} 

} 

我得到的PHPUnit的反应,但似乎并没有被与Selenium服务器通信,因为没有创建浏览器窗口。

PHPUnit 3.6.10 by Sebastian Bergmann. 

Configuration read from /var/www/gcd/framework/yii/gadget/protected/tests/phpunit.xml 

F 

Time: 1 second, Memory: 10.50Mb 

There was 1 failure: 

1) WebTest::testTitle 
Failed asserting that null matches expected 'Example WWW Page'. 

使用PHPUnit的3.6.10和硒的服务器独立-2.21.0

任何人任何想法?

+0

原来,如果你用sudo运行PHPUnit,它就可以工作!卫生署! – dmag

回答

2

原来,如果你用sudo运行PHPUnit,它就可以工作!卫生署!