【问题标题】:Why am I not getting an error when I use PHPUnit + Selenium Server?为什么我在使用 PHPUnit + Selenium Server 时没有收到错误消息?
【发布时间】:2012-09-07 00:16:06
【问题描述】:

当我使用 PHPUnit + Selenium Server 使用不存在的电子邮件和密码登录时,为什么我没有收到错误消息? 这是 PHPUnit 脚本。

public function testUserNotExists() {
    $this->open('https://dev.example.com/login');
    $this->type("id=email", "1d0ntex1s7@live.com");
    $this->type("id=password", "1d0n73x1s7");
    $this->click("name=login_user");

}

当我运行它时,它不会显示错误

终端:phpunit ExampleTest.php Sebastian Bergmann 的 PHPUnit 3.6.12。

E...

时间:29 秒,内存:4.75Mb

有 1 个错误:

1) ExampleTest::testTitle

方法 assertTitleEquals 未定义。

失败! 测试:4,断言:1,错误:1。

【问题讨论】:

    标签: selenium phpunit selenium-rc


    【解决方案1】:

    你必须写assertions 才能获得一些失败。 Selenium 不知道在发送某种表单后应该(或不应该)发生什么。

    【讨论】:

    • 谢谢,我试图弄清楚为什么它几个小时都没有显示错误。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-12-16
    • 2016-04-24
    • 2011-04-22
    • 2015-01-25
    • 1970-01-01
    • 1970-01-01
    • 2010-12-11
    相关资源
    最近更新 更多