如何在PHP中使用Selenium? [英] How to use Selenium with PHP?

查看:632
本文介绍了如何在PHP中使用Selenium?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用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.

推荐答案

尝试以下操作

  1. 安装并运行Phpunit
  2. 也有JAVA sdk& jre在您的计算机上.
  3. 现在使用Selenium IDE记录测试用例.
  4. 将测试用例导出到php文件.
  5. 使用这些导出的函数创建测试用例库.
  6. 创建套件,该套件从库中调用函数/测试.
  7. 现在可以使用java命令执行Start Selenium Server.
  8. 使用phpunit执行套件.

有关如何编写这些文件的信息,请点击此处,然后尝试git hub

for refrence how to write these files click here and also try on git hub

这篇关于如何在PHP中使用Selenium?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆