我可以在selenium IDE中制作selenium脚本,并且可以将它导出到PHPUnit中。 我也安装了PHPUnit(我猜测安装正确)和硒-rc服务器(完美运行)。 然后我运行这些脚本使用命令:'PHPUnit Testname.php',它没有提供任何输出。 如果有人知道关于运行这些PHPUnit脚本的任何内容,请稍微介绍一下。 谢谢.............如何使用PHPUnit在Selenium RC中运行Selenium IDE脚本?
0
A
回答
0
运行测试(不使用过滤器等)的命令包含测试套件名称,从中可以推导出文件名。所以,
phpunit Testname
而不是
phpunit Testname.php
0
确保您的硒RC运行。例如(Java的罐子硒的server.jar)
尝试保存该试验为:
PHPUnit的exampleTest:
exampleTest.php
然后通过命令行作为运行它。 php
希望这会有所帮助。
<?php
require_once 'PHPUnit/Framework.php';
require_once 'PHPUnit/Extensions/SeleniumTestCase.php';
class exampleTest extends PHPUnit_Extensions_SeleniumTestCase
{
protected function setUp()
{
$this->setBrowser('*firefox');
$this->setBrowserUrl('http://www.google.com');
}
public function testexampleTest()
{
echo "Navigating browser to stackoverflow.com ...";
$this->open('http://www.stackoverflow.com/');
$this->waitForPageToLoad('30000');
echo "Made it to stackoverflow!";
$this->sleep(5);
echo "Test Complete";
}
}
?>
相关问题
- 1. 如何在Selenium RC中运行Selenium IDE脚本?
- 2. 如何远程运行Selenium RC + PHPUnit + NetBeans?
- 3. Selenium RC,如何在远程机器上运行硒RC脚本
- 4. 了解Selenium IDE和Selenium RC
- 5. 如何使用Selenium RC运行/执行Perl脚本?
- 6. 如何在PHPUnit + Selenium中运行测试?
- 7. 如何使用Selenium RC运行Google Chrome?
- 8. 使用Selenium IDE进行文件上传(不是Selenium WD/RC)
- 9. 如何使用Selenium RC进行Selenium IDE测试用例依赖关系?
- 10. Selenium-PHPUnit,Selenium Grid
- 11. 在多个浏览器中同时运行Selenium RC脚本
- 12. 如何在Selenium RC中执行Javascript
- 13. 如何在Selenium Grid2上运行Selenium IDE中记录的测试?
- 14. 获取phpunit导出的selenium IDE文件在WebDriver中运行
- 15. 运行Selenium-RC的问题
- 16. 我可以通过selenium使用firefox ide运行powershell脚本吗?
- 17. 如何让PHPUnit + Selenium运行得更快?
- 18. 如何在Selenium RC中使用storeAttribute
- 19. 用户在运行selenium IDE脚本时手动输入
- 20. Selenium RC脚本未在Internet Explorer上运行
- 21. 错误:未找到元素在Selenium IDE中运行良好,但在Selenium RC中未运行。获取错误
- 22. 如何在运行时在Selenium IDE中获取文本框ID
- 23. 如何在Selenium IDE中运行嵌入在页面中的脚本?
- 24. 使用Selenium IDE
- 25. 无法在selenium中运行脚本java
- 26. 如何在Selenium IDE中使用selectAndWait?
- 27. 如何在Selenium IDE中使用TestNG?
- 28. 如何在Internet Explorer中运行selenium rc测试用例
- 29. Selenium RC - 用Selenium IDE找到表格单元格有困难
- 30. 如何使用WebDriver运行Selenium 2.0 RC -htmlSuite?
您好,感谢您的答复......我尝试了上面的命令也....但仍然没有输出....你可以请建议一些其他的方式... –
@ankur在新的命令提示符输入文件的特定目录位置并输入phpunit xyz.php – 2011-07-26 14:39:41