AWBot-A Nice Tool to Test Your Web Site


AWBot 简介

AWBot 是一款易用的测试 Web 站点的小工具。站点在 http://awbot.sourceforge.net 。该项目是 AWstats 项目的辅助项目。
AWbot 的功能简单的说,可以模拟用户访问站点的行为,测试站点的响应度和负载压力,并可进行基准测试。

具体来讲,AWbot 具有如下特性:

  • 易用性好.
  • 支持基本的HTTP验证请求.
  • 可以在测试前后制定不同预提交任务(外部脚本,SQL命令等).
  • 可以检查每个HTML页面的HTTP请求的结果以验证是否内容包含特性的关键字或是要解析的值.
  • 可以动态定义用以测试的URL与参数.
  • 可以多会话运行来测试负载压力.
  • 针对每个页面报告错误,响应时间和平均响应时间
  • 开放源码 (GNU General Public License)
  • AWBot 具有 XML PAD( Portable Application Description).
  • 其他一些特性

安装需求

AWBot要求系统必须满足如下要求:

  • 系统必须要有Perl的支持,可运行Perl脚本。否则的话,要下载Perl : ActivePerl (Win32) 或者在 Perl.com (Unix/Linux/Other).
  • 必须添加Perl模块Time::HiRes,使得 时间 可以取到毫秒.
  • 如果要执行提交前SQL命令的话,要添加DBI/DBD 数据库 perl 模块.

安装参考

以下是一份Linux系统上安装操作的Log:

#############Installing Time::HiRes####################
#下载 Time::HiRes 模块 注意:文件名字和连接可能会有变化
wget http://www.cpan.org/modules/by-module/Time/Time-HiRes-1.65.tar.gz
tar -zxvf Time-HiRes-1.65.tar.gz
cd Time-HiRes-1.65
perl Makefile.PL
make
#如果有错误信息的话表明你的环境变量有所不同,需要进行如下操作
export LC_ALL=C
perl Makefile.PL
make
make install
#安装 Time::HiRes 完毕
##############Installing AWBot######################
wget http://awbot.sourceforge.net/files/awbot.tgz
#解压缩
tar -zxvf awbot.tgz
cd awbot-1.0/
#把配置文件模板复制一份:
cp awbot.test.conf awbot.dbanotes.conf
vi awbot.dbanotes.conf
#进行基本配置:
OUTPUTDIR = "./output" # 输出文件的位置(必须存在并可写)
SERVER = "www.dbanotes.net" # 待测试的站点域名
#USER = "test" # 如果Web应用程序需要认证的话,在这里添入用户名字,并去掉注释
#PASSWORD = "test" # 如果Web应用程序需要认证的话,在这里添入用户密码,并去掉注释
......
LANG = "en" # 输出内容的语言

AWBot脚本还可以有很多参数选项,我们来看看参数:

# perl awbot.pl
----- awbot 1.0 (build 1.3) -----
Advanced Web Bot is a tool to test a web server.
Usage: awbot.pl -config=testconfigfile [options]
Where options are:
-server=xxx Overwrite SERVER value of testconfig file.
-user=xxx Overwrite USER value of testconfig file.
-password=xxx Overwrite PASSWORD value of testconfig file.
-delay=n Overwrite DELAY value of testconfig file.
-timeout=n Overwrite TIMEOUT value of testconfig file.
-loadimages Load image files.
-nostopiferror Awbot continues with next test when an error occurs.
-prepareonly Only execute pre-actions.
-executeonly Do not execute any pre-actions nor post-actions.
-id Output file name contains process ID number.
-verbose Output file is also reported on std output (screen).
-silent Nothing on std output (screen).
-debug=X To add debug informations lesser than level X
Now supports/detects:
Several predefined post-test or pre-test actions (Scripts, SQL request...)
Web sites with Basic HTTP/Proxy authentication
Easy to configure (one config file)
Configuration and Test plan can be defined dynamically (using variables
catched from a previous test)
Possible use of several simultanous sessions (with awbotlaunch.pl)

参数的解释比较详细,要不怎么说AWBot是个简单易用的工具呢。

基本用法

# perl awbot.pl -config=awbot.dbanotes.conf -verbose
TEST awbot 1.0 (build 1.3)
---------------------------
Config file: awbot.dbanotes.conf
Server: www.dbanotes.net - User: - Delay: 0
Botname: AWBot - TimeOut: 120 - MaxSize: 0
Date: 2004-10-13 13:13:15
Process ID: 21139
PRE ACTIONS
---------------------------
ACTIONS
---------------------------
2004/10/13-13:13:15:534 URL 1 - https://www.dbanotes.net/
---> OK - 2771.027 ms
POST ACTIONS
---------------------------
SUMMARY
---------------------------
Total requests to do: 1
Total requests sent: 1 (1 answered)
Total requests duration: 2771.027 ms
Average requests response time: 2771 ms/request
Total Check Yes: 0/0 No: 0/0
Faster request response time: URL 1 - 2771 ms
Slower request response time: URL 1 - 2771 ms
URL 1 - Duration: 2771 ms - Cumul: 2771 ms - Check Yes: 0 / 0 No: 0 / 0

参考信息

AWbot – http://awbot.sourceforge.net
AWBot’s Doc – http://awbot.sourceforge.net/docs/

若SourceForge不可访问,可在本站浏览联机文档: https://www.dbanotes.net/awbot/awbot.sourceforge.net/docs/index.html


Leave a Reply

Your email address will not be published. Required fields are marked *