php – 无法使用多个方法参数调用命令

发布时间:2022-04-30 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了php – 无法使用多个方法参数调用命令脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
每次我尝试使用一个基本的 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.

脚本宝典总结

以上是脚本宝典为你收集整理的php – 无法使用多个方法参数调用命令全部内容,希望文章能够帮你解决php – 无法使用多个方法参数调用命令所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。