我想要在多個瀏覽器上使用selenium2運行phpunit測試的一些幫助。我有以下phpunit測試,它可以在Firefox瀏覽器上正常運行。我如何對Chrome,IE,Opera,Safari等其他人運行它?如何在不同的瀏覽器上使用selenium2運行phpunit測試
如果可以幫忙,我已經在下面添加了測試用例。任何鏈接,以幫助網站將不勝感激。
class exampleTestcase2 extends PHPUnit_Extensions_Selenium2TestCase {
public function setUp()
{
$this->setHost('localhost'); // Set the hostname for the connection to the Selenium server.
$this->setPort(4444); // set port # for connection to selenium server
$this->setBrowser('firefox'); // set the browser to be usedRequest State Change
$this->setBrowserUrl('http://www.php.net/'); // set base URL for tests
}
public function testCMS() // Test the title on index page
{
$this->currentWindow()->maximize(); // open window in full screen
$this->url('index.php'); // Set the URL to access the login page
$this->assertEquals('PHP: Hypertext Preprocessor', $this->title());
}
}