phpunit+selenium环境搭建

这个环境搭建遇到了挺多麻烦,最终还是没能自己解决,幸好有同事“青蛙”的帮忙解决了这个问题!在这里把本人亲测步骤给大家列一下,希望给大家提供方便!

安装pear:

Go-pear.phar下载地址:http://download.csdn.net/detail/e421083458/4602207

下载go-pear.phar文件到C:\wamp\bin\php\php5.3.13\PEAR中

然后执行以下命令:

cd C:\wamp\bin\php\php5.3.13

php -d phar.require_hash=0 PEAR/go-pear.phar

然后就是遇到回车就回车,输入Y就Y。安装之后它会提示你双击一下。

c:\wamp\bin\php\php5.3.13\PEAR_ENV.reg 以添加环境变量 照做就是。为了下面操作和以后使用方便需要将php添加到环境变量里面。

升级pear :

直接安装phpunit它会提示版本过低 这里就要升级pear了

Pear clear-cache

pear upgrade pear

成功升级后的截图:

Pear upgrade-all

产品升级后的截图

安装phpunit

pear clear-cache

pear channel-discover pear.phpunit.de

pear channel-discover components.ez.no

pear channel-discover pear.symfony-project.com

pear install -a -f phpunit/PHPUnit

安装成功截图:

安装phpunit扩展

pear channel-discover pear.symfony.com

pear install phpunit/DbUnit

pear channel-discover pear.phpunit.de

pear install phpunit/PHPUnit_Story

成功截图:

安装selenium扩展

pear install phpunit/PHPUnit_Selenium

成功截图:

调试selenium

selenium-server-standalone-2.6.0.jar下载地址:http://download.csdn.net/detail/e421083458/4882037

打开selenium-server

java -jar C:\wamp\selenium-server-standalone-2.25.0.jar -interactive -log selenium.log

成功截图:

安装firefox的selenium IDE插件

地址:http://seleniumhq.org/download/

点击1.9.0进行selenium IDE安装。

具体录制方法见:

http://blog.163.com/lgh_2002/blog/static/44017526201259113351146/

测试脚本:

baiduCase.php

class Example extends PHPUnit_Extensions_SeleniumTestCase

{

protected function setUp()

{

$this->setBrowser("*firefox");

$this->setBrowserUrl("http://www.baidu.com/");

}

public function testMyTestCase()

{

$this->open("/");

$this->type("id=kw", "你好");

$this->click("id=su");

$this->waitForPageToLoad("30000");

$this->assertEquals(0,0);

}

}

?>

开始测试:

phpunit baiduCase.php

测试成功截图:

参考文档:

http://www.phpunit.de/manual/3.7/en/index.html

http://pear.phpunit.de/

http://seleniumhq.org/download/

php phpunit selenium,phpunit+selenium环境筹建相关推荐

  1. selenium + python自动化测试环境搭建

    elenium 是一个web的自动化测试工具,不少学习功能自动化的同学开始首选selenium ,相因为它相比QTP有诸多有点: 免费,也不用再为破解QTP而大伤脑筋 小巧,对于不同的语言它只是一个包 ...

  2. Selenium + Nightwatch 自动化测试环境搭建

    首先要安装 Java 7 或更高 ,(http://www.oracle.com/technetwork/java/javase/downloads/index.html) 并且 java 命令可正常 ...

  3. chromedriver 下载_centos7中配置python爬虫selenium+chromium+chromedriver环境

    今天为了爬取某异步加载网站的数据,开始自学了selenium,不得不说selenium还是很方便的工具,适合无脑爬取异步加载的网站.首先我在自己的windows电脑下配置了selenium和chrom ...

  4. docker+selenium web自动化测试环境的部署

    docker+selenium web自动化测试环境的部署 1.使用SecureCRT或Docker Quickstart Terminal打开docker终端. 2.下载selemiunUI测试需要 ...

  5. 爬空气质量MySQL_爬虫:利用selenium采集某某环境网站的空气质量数据

    前言:在上一篇文章中,我们介绍了在http://PM2.5.in这个网站采集空气质量的数据,本篇文章是对其产生的一些问题的另一种解决方案,提供更加权威的数据采集. 技术框架:selenium.json ...

  6. python+selenium自动化测试-Windows环境搭建

    来自python+selenium自动化测试初学者的笔记,写的不对的地方大家多多指教哦 一.安装selenium 安装selenium需要先安装python环境,python环境在之前的python+ ...

  7. Web应用测试(一)Selenium介绍及环境搭建

    Selenium介绍及环境搭建 一.背景介绍: (更好的阅读体验,请移步我的个人博客)软件测试比赛刚刚落下帷幕,在空档期,写写这些天的感受.不知不觉参加了好多次软件测试比赛了,开发者测试,移动应用测试 ...

  8. 【重点】Selenium + Nightwatch 自动化测试环境搭建

    开始搭建 1. 创建项目 我们来找个地方新建一个目录,起名为 "my-test-toolkit",然后在目录内使用终端运行 npm init -y 生成项目配置文件package. ...

  9. selenium python_Python+Selenium基础入门及实践

    一.Selenium+Python环境搭建及配置 1.1 selenium 介绍 selenium 是一个 web 的自动化测试工具,不少学习功能自动化的同学开始首选 selenium ,因为它相比 ...

  10. 【selenium】 selenium web测试工具介绍(一)

    从什么开始呢,就介绍一下最近接触到的一个强大的开源前端测试工具吧-- selenium-- 网上有很多关于这个工具的介绍,但是感觉主要还是关于这个工具的安装和官方文档的衍生品,实际的介绍好像很少-- ...

最新文章

  1. #423 Div2 D
  2. EPnP:一种复杂度为O(N)的求解PnP问题的方法
  3. Redis学习和环境搭建
  4. Lucene-Analyzer
  5. cakephp2 框架下的 持久处理 不丢失数据库连接 后台挂起执行。
  6. druid mysql配置详解_druid配置详解
  7. 成功解决AttributeError: module tensorflow has no attribute random_normal
  8. Golang之slice操作
  9. SAP CRM WebClient UI的configuration按钮点击之后,发生了什么事情
  10. 干货首发,能够清理,带动画的自己定义控件CuteEditText
  11. python能画k线图吗_,求教使用python绘制K线图
  12. MTK 驱动(20)--- camera 相机启动时间优化
  13. python实验报告实验总结_python实验报告一
  14. 高级会计职称计算机考什么,会计高级职称考哪些科目
  15. 【新书速递】深入浅出Electron
  16. 2008年8月27号,星期三,晴。锲而舍之,朽木不折;锲而不舍,金石可镂。 ——《荀子•劝学》2008年8月27号,星期三,晴。
  17. iOS Game Center 登陆验证实现
  18. DMP 数据管理平台极简教程 ( Data Management Platform )
  19. 智能流程机器人助你“聚划算”
  20. 数据结构上机实验6.29

热门文章

  1. 1045 Favorite Color Stripe (30 分)【难度: 中 / 知识点: DP】
  2. Linux的crontab任务调度
  3. 3.5.5 CSMA/CD 协议
  4. 3.3.2 差错控制(检错编码)
  5. cmd命令快速启动、暂停和关闭sql server服务
  6. 2018年JavaWeb和移动程序员学习的12个框架
  7. 【struts2+hibernate+spring项目实战】实现用户登录功能(ssh)
  8. 蓝桥杯java第八届第九题--分巧克力
  9. 剑指offer(26-33题)详解
  10. 用java爬取杭电oj已ac代码