我想讓Selenium Web Driver使用Yii框架使用php。Selenium web驅動無法加載網頁在Firefox中
phpunit已安裝並正在運行。
我已經運行了最新版本的selenium服務器。 (selenium-server-standalone-2.37.0.jar)
我有this Yii extension for web driver installed。
我有這個shell測試。
Yii::import('ext.webdriver-bindings.CWebDriverDbTestCase');
class SiteTest extends CWebDriverDbTestCase
{
public function testExample() {
$this->get("http://www.example.com");
$this->assertTrue($this->isTextPresent('Example Domain'));
$this->assertTrue(true);
}
}
當我與
phpunit functional/SiteTest.php
的測試運行在命令行上運行它。 Firefox會打開一個空白配置文件(安裝了網絡驅動程序插件),但網頁無法加載。地址欄中沒有任何內容。完全沒有任何反應。瀏覽器保持打開狀態,同時命令行顯示以下內容。
PHPUnit 3.7.28 by Sebastian Bergmann.
Configuration read from C:\full\path\to\yii\project\protected\tests\phpunit.xml
F
Time: 4.88 seconds, Memory: 3.50Mb
There was 1 failure:
1) SiteTest::testExample
Failed asserting that false is true.
C:\full\path\to\yii\project\protected\tests\functional\SiteTest.php:18
FAILURES!
Tests: 1, Assertions: 1, Failures: 1.
我在Windows 7上,並試圖關閉防火牆,看看是否是原因。
正如你可以看到,第二次測試通過時,phpunit工作正常。但由於某種原因,Firefox不打開請求的頁面。
編輯:我使用PHP的最新版本(5.5.5)
編輯:現在我也試圖與Chrome的驅動程序。我得到相同的結果。 Chrome會打開,但頁面無法加載。地址欄中只有'data :,'。