1

我正在使用 phpunit selenum 测试在 yii 中编写 Web 应用程序,这里是我的登录表单测试用例

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]','pradeep@techanveshan.com');
        $this->type('name=LoginForm[password]','password');

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

    }

一切正常,除非我输入这个命令 $this->clickAndWait("//input[@value='Login']");

这一行给了我这样的错误:

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.

有谁知道为什么会这样?

4

1 回答 1

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

相反,您可以使用

$this->click("//input[@value='Login']");
$this->waitforpagetoload("30000");
于 2013-06-03T07:16:10.023 回答