功能测试clickAndWait不起作用

时间:2013-06-03 05:59:26

标签: php selenium yii phpunit selenium-webdriver

我正在使用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

    }

除非我输入此命令,否则一切正常 的 $这 - > 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.

有谁知道为什么会这样?

1 个答案:

答案 0 :(得分:5)

clickAndWait() is not available in RC or webdriver.

相反,您可以使用

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