2013-06-03 35 views
1

我在這裏的PHPUnit的selenum測試警予編寫Web應用程序是我測試的情況下登錄表單功能測試clickAndWait不工作

public function testHasLoginForm() 
    { 
     $this->open('site/login'); 
     $this->assertTextPresent('Login'); 

     $this->assertElementPresent('name=LoginForm[username]'); 
     $this->assertElementPresent('name=LoginForm[password]'); 

     $this->assertTextPresent('Remember me next time'); 
     $this->assertTextPresent('Reset Password?'); 

     $this->assertElementPresent('name=Login'); 

     $this->type('name=LoginForm[username]','[email protected]'); 
     $this->type('name=LoginForm[password]','password'); 

     $this->clickAndWait("//input[@value='Login']"); //this line cause the error 

    } 

一切正常,除非找到我把這個命令 $這個 - > clickAndWait( 「//輸入[@值= '登錄']」);

這一行給了我錯誤是這樣的:

Invalid response while accessing the Selenium Server at "http://localhost:4444/s 
elenium-server/driver/:" ERROR: Command execution failure. Please search the use 
r group at https://groups.google.com/forum/#!forum/selenium-users for error deta 
ils from the log window. The error message is: Value does not implement interfa 
ce Event. 

沒有人有想法,爲什麼會出現這種情況?

+0

嘗試通過名稱點擊: $這個 - > clickAndWait( '//輸入[名稱= 「LoginForm的[用戶名]」]'); – Sergey

回答

5
clickAndWait() is not available in RC or webdriver. 

相反,你可以使用

$this->click("//input[@value='Login']"); 
$this->waitforpagetoload("30000");