php – 无法使用多个方法参数调用命令
发布时间:2020-05-31 00:56:31 所属栏目:PHP 来源:互联网
导读:每次我尝试使用一个基本的 PHPUnit Selenium断言时,测试都会出错并显示以下消息: Exception: You cannot call a command with multiple method arguments. 在http://phpunit.de/manual/3.7/en/selenium.html,它显示使用情况: void assertElementValueEqua
每次我尝试使用一个基本的 PHPUnit Selenium断言时,测试都会出错并显示以下消息: Exception: You cannot call a command with multiple method arguments. 在http://phpunit.de/manual/3.7/en/selenium.html,它显示使用情况: void assertElementValueEquals(string $locator,string $text) 当我打电话给它时 $this->assertElementValueEquals( 'id=date_1_formatted','2013-01-01' ); 每次测试都会产生上述错误,即使这种格式似乎适用于其他问题,例如问题Using PHPUnit with Selenium,how can I test that an element contains exactly something? selenium2TestCase中未实现assertElementValueEquals.在你的链接上它提到了SeleniumTestCase(Selenium RC版本).此外,你使用了正确的结构与$this-> byXPath,就像这里https://github.com/sebastianbergmann/phpunit-selenium/blob/master/Tests/Selenium2TestCaseTest.php 您也可以使用$this-> byId(): $element = $this->byId('date_1_formatted'); $this->assertEquals('2013-01-01',$element->value()); P. S.:如果您熟悉Selenium IDE,可以试试这个command line tool. (编辑:安卓应用网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |