使用sampletest进行web测试
来源:互联网 发布:java对象是什么意思 编辑:程序博客网 时间:2024/05/23 09:41
Web不测试不同于一般的单元测试,它是基于HTTP协议的.这表现在HTTP协议的特点是没有链接状态的.同时又涉及到于浏览器的交互(包括表单,链接状态),所以比较麻烦.SimpleTest提供了一套比较完整的基于PHP的测试脚本
一: 表单测试
<?php
require_once 'simpletest/unit_tester.php';
require_once 'simpletest/web_tester.php';
require_once 'simpletest/reporter.php';
class PassportRegister extends WebTestCase {
// 论坛登录测试
function testPhpChina() {
$this->get('http://www.phpchina.com/bbs/logging.php?action=login');
$this->setField('username', 'your_username');
$this->setField('password', '******');
//元素的type属性为submit的input元素的name
$this->clickSubmitByName('loginsubmit');
// 登录结果页包含文本
$this->assertText('your_username');
}
}
if (!defined('RUN_ALL')) {
$test = new PassportRegister();
$test->run(new HtmlReporter('utf-8'));
}
?>
require_once 'simpletest/unit_tester.php';
require_once 'simpletest/web_tester.php';
require_once 'simpletest/reporter.php';
class PassportRegister extends WebTestCase {
// 论坛登录测试
function testPhpChina() {
$this->get('http://www.phpchina.com/bbs/logging.php?action=login');
$this->setField('username', 'your_username');
$this->setField('password', '******');
//元素的type属性为submit的input元素的name
$this->clickSubmitByName('loginsubmit');
// 登录结果页包含文本
$this->assertText('your_username');
}
}
if (!defined('RUN_ALL')) {
$test = new PassportRegister();
$test->run(new HtmlReporter('utf-8'));
}
?>
待续......
- 使用sampletest进行web测试
- 使用sampletest进行web测试
- 使用VS2005进行WEB功能测试
- 使用Siege进行WEB压力测试
- 使用WatiN进行自动化Web界面测试
- 使用VS2008进行WEB负载测试
- 使用VS2008进行WEB负载测试
- 使用QTP进行WEB页面性能测试
- 使用Siege进行WEB压力测试
- 使用VS2008进行WEB负载测试
- 使用Siege进行WEB压力测试
- 使用Siege进行WEB压力测试
- 使用selenium进行web测试项目框架
- 使用VS2005进行WEB功能测试
- 使用Siege进行WEB压力测试
- 使用autobench进行web压力测试
- 使用Postman进行Web API测试
- 使用Fiddler进行Web接口测试
- 入市基础普及篇(策略篇)
- 玩的不错
- 来电闪光电话
- jdom入门(基本的操作都可以)
- Introduction to Asynchronous Programming in .NET 2.0
- 使用sampletest进行web测试
- 无标题栏窗口拖动的实现
- Hibernate 级联保存时 偶尔会出现 "id to load is required for loading" 问题的解决办法
- Asynchronous Programming Model in .NET 2.0
- PHP框架大比武2.0
- 主页屏蔽左右键便用方法与分解
- Linux编程指导
- 使用jsp实现word、excel格式报表打印(二)
- 当前最重要的十大开发技术