如何在PHP中使用Selenium? [英] How to use Selenium with PHP?
问题描述
我想使用Selenium来自动化一些Web任务(不用于测试).我认为我已经安装了Selenium RC Server,但是由于我无法在PHP中找到客户端驱动程序,因此无法编写测试脚本"(请参阅: http://seleniumhq.org/download/).
I'd like to use Selenium to automate a few web tasks (not for testing). I think I have Selenium RC Server installed, but have no way of writing "test scripts" since I can't find a client driver in PHP (see: http://seleniumhq.org/download/).
我有办法在PHP中使用Selenium吗?这似乎表明我需要PHPUnit http://www.phpunit.de/manual/当前/zh/selenium.html .我只想自动化一些任务,而不参与一整套测试.
Is there a way for me to use Selenium with PHP? This seems to suggest I need PHPUnit http://www.phpunit.de/manual/current/en/selenium.html. I just want to automate a few tasks, not get involved with a full suite of testing.
推荐答案
尝试以下操作
- 安装并运行Phpunit
- 也有JAVA sdk& jre在您的计算机上.
- 现在使用Selenium IDE记录测试用例.
- 将测试用例导出到php文件.
- 使用这些导出的函数创建测试用例库.
- 创建套件,该套件从库中调用函数/测试.
- 现在可以使用java命令执行Start Selenium Server.
- 使用phpunit执行套件.
有关如何编写这些文件的信息,请点击此处,然后尝试git hub
for refrence how to write these files click here and also try on git hub
这篇关于如何在PHP中使用Selenium?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!