Chinaunix首页 | 论坛 | 博客
  • 博客访问: 119392
  • 博文数量: 87
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 0
  • 用 户 组: 普通用户
  • 注册时间: 2017-12-21 12:14
文章分类

全部博文(87)

文章存档

2015年(10)

2014年(2)

2013年(6)

2012年(69)

我的朋友

分类: Windows平台

2015-03-19 10:43:24

一、输入框

1、字符型输入框:

(1)字符型输入框:英文全角、英文半角、数字、空或者空格、特殊字符~!@#¥%……&*?[]{}特别要注意单引号和&符号。禁止直接输入特殊字符时,使用粘贴、拷贝功能尝试输入。

(2)长度检查:最小长度、最大长度、最小长度-1、最大长度+1、输入超工字符比如把整个文章拷贝过去。

(3)空格检查:输入的字符间有空格、字符前有空格、字符后有空格、字符前后有空格

(4)多行文本框输入:允许回车换行、保存后再显示能够保存输入的格式、仅输入回车换行,检查能否正确保存(若能,检查保存结果,若不能,查看是否有正常提示)、

(5)安全性检查:输入特殊字符串(null,NULL, ,javascript,,,<html>,<td>)、输入脚本函数(<script>alert("abc")</script>)、doucment.write("abc")、<b>hello</b>) </p> <p align="left" style="margin:10px auto;"> 2、数值型输入框: </p> <p align="left" style="margin:10px auto;"> (1)边界值:最大值、最小值、最大值+1、最小值-1  </p> <p align="left" style="margin:10px auto;"> (2)位数:最小位数、最大位数、最小位数-1最大位数+1、输入超长值、输入整数  </p> <p align="left" style="margin:10px auto;"> (3)异常值、特殊字符:输入空白(NULL)、空格或"~!@#$%^&*()_+{}|[]\:"<>?;',./?;:'-=等可能导致系统错误的字符、禁止直接输入特殊字符时,尝试使用粘贴拷贝查看是否能正常提交、word中的特殊功能,通过剪贴板拷贝到输入框,分页符,分节符类似公式的上下标等、数值的特殊符号如<span style="font-family:'Times New Roman';">∑</span>,㏒,㏑,<span style="font-family:'Times New Roman';">∏</span>,+,-等、 </p> <p align="left" style="margin:10px auto;"> 输入负整数、负小数、分数、输入字母或汉字、小数(小数前0点舍去的情况,多个小数点的情况)、首位为0的数字如01、02、科学计数法是否支持1.0E2、全角数字与半角数字、数字与字母混合、16进制,8进制数值、货币型输入(允许小数点后面几位)、 </p> <p align="left" style="margin:10px auto;"> (4)安全性检查:不能直接输入就copy </p> <p align="left" style="margin:10px auto;"> 3、日期型输入框: </p> <p align="left" style="margin:10px auto;"> (1)合法性检查:(输入0日、1日、32日)、月输入[1、3、5、7、8、10、12]、日输入[31]、月输入[4、6、9、11]、日输入[30][31]、输入非闰年,月输入[2],日期输入[28、29]、输入闰年,月输入[2]、日期输入[29、30]、月输入[0、1、12、13] </p> <p align="left" style="margin:10px auto;">  (2)异常值、特殊字符:输入空白或NULL、输入~!@#¥%……&*(){}[]等可能导致系统错误的字符 </p> <p align="left" style="margin:10px auto;"> (3)安全性检查:不能直接输入,就copy,是否数据检验出错? </p> <p align="left" style="margin:10px auto;"> 4、信息重复:在一些需要命名,且名字应该唯一的信息输入重复的名字或ID,看系统有没有处理,会否报错,重名包括是否区分大小写,以及在输入内容的前后输入空格,系统是否作出正确处理. </p> <p align="left" style="margin:10px auto;"> <strong>二、搜索功能</strong> </p> <p align="left" style="margin:10px auto;"> 若查询条件为输入框,则参考输入框对应类型的<span style="text-decoration:underline;"><a href="http://www.cnblogs.com/Jessy/admin/..:;" style="color:#729773;text-decoration:none;"><strong>测试</strong></a></span>方法 </p> <p align="left" style="margin:10px auto;"> 1、功能实现: </p> <p align="left" style="margin:10px auto;"> (1)如果支持模糊查询,搜索名称中任意一个字符是否能搜索到 </p> <p align="left" style="margin:10px auto;"> (2)比较长的名称是否能查到 </p> <p align="left" style="margin:10px auto;"> (3)输入系统中不存在的与之匹配的条件 </p> <p align="left" style="margin:10px auto;"> (4)用户进行查询操作时,一般情况是不进行查询条件的清空,除非需求特殊说明。 </p> <p align="left" style="margin:10px auto;"> 2、组合测试: </p> <p align="left" style="margin:10px auto;"> (1)不同查询条件之间来回选择,是否出现页面错误(单选框和多选框最容易出错) </p> <p align="left" style="margin:10px auto;"> (2)测试多个查询条件时,要注意查询条件的组合测试,可能不同组合的测试会报错。 </p> <p align="left" style="margin:10px auto;">   </p> <p align="left" style="margin:10px auto;"> 三、<strong>添加、修改功能</strong> </p> <p align="left" style="margin:10px auto;"> 1、特殊键:(1)是否支持Tab键 (2)是否支持回车键 </p> <p align="left" style="margin:10px auto;"> 2、提示信息:(1)不符合要求的地方是否有错误提示 </p> <p align="left" style="margin:10px auto;"> 3、唯一性:(1)字段唯一的,是否可以重复添加,添加后是否能修改为已存在的字段(字段包括区分大小写以及在输入的内容前后输入空格,保存后,数据是否真的插入到<span style="text-decoration:underline;"><strong>数据库</strong></span>中,注意保存后数据的正确性) </p> <p align="left" style="margin:10px auto;"> 4、数据 正确性: </p> <p align="left" style="margin:10px auto;"> (1)对编辑页的每个编辑项进行修改,点击保存,是否可以保存成功,检查想关联的数据是否得到更新。 </p> <p align="left" style="margin:10px auto;"> (2)进行必填项检查(即是否给出提示以及提示后是否依然把数据存到数据库中;是否提示后出现页码错乱等) </p> <p align="left" style="margin:10px auto;"> (3)是否能够连续添加(针对特殊情况) </p> <p align="left" style="margin:10px auto;"> (4)在编辑的时候,注意编辑项的长度限制,有时在添加的时候有,在编辑的时候却没有(注意要添加和修改规则是否一致) </p> <p align="left" style="margin:10px auto;"> (5)对于有图片上传功能的编辑框,若不上传图片,查看编辑页面时是否显示有默认的图片,若上传图片,查看是否显示为上传图片 </p> <p align="left" style="margin:10px auto;"> (6)修改后增加数据后,特别要注意查询页面的数据是否及时更新,特别是在首页时要注意数据的更新。 </p> <p align="left" style="margin:10px auto;"> (7)提交数据时,连续多次点击,查看系统会不会连续增加几条相同的数据或报错。 </p> <p align="left" style="margin:10px auto;"> (8)若结果列表中没有记录或者没选择某条记录,点击修改按钮,系统会抛异常。 </p> <p align="left" style="margin:10px auto;">   </p> <p align="left" style="margin:10px auto;"> <strong>四、删除功能</strong> </p> <p align="left" style="margin:10px auto;"> 1、特殊键:(1)是否支持Tab键 (2)是否支持回车键 </p> <p align="left" style="margin:10px auto;"> 2、提示信息:(1)不选择任何信息,直接点击删除按钮,是否有提示(2)删除某条信息时,应该有确认提示 </p> <p align="left" style="margin:10px auto;"> 3、数据 实现:(1)是否能连续删除多个产品(2)当只有一条数据时,是否可以删除成功 (3)删除一条数据后,是否可以添加相同的数据(4)如系统支持批量删除,注意删除的信息是否正确 (5)如有全选,注意是否把所有的数据删除(6)删除数据时,要注意相应查询页面的数据是否及时更新 (7)如删除的数据与<span style="text-decoration:underline;"><strong>其他</strong></span>业务数据关联,要注意其关联性(如删除部门信息时,部门下游员工,则应该给出提示)(8)如果结果列表中没有记录或没有选择任何一条记录,点击删除按钮系统会报错。 </p> <p align="left" style="margin:10px auto;">   </p> <p align="left" style="margin:10px auto;"> 如:某一功能模块具有最基本的增删改查功能,则需要进行以下测试 </p> <p align="left" style="margin:10px auto;"> 单项<span style="text-decoration:underline;"><strong>功能测试</strong></span>(增加、修改、查询、删除) </p> <p align="left" style="margin:10px auto;"> 增加——>增加——>增加 (连续增加测试) </p> <p align="left" style="margin:10px auto;"> 增加——>删除 </p> <p align="left" style="margin:10px auto;"> 增加——>删除——>增加 (新增加的内容与删除内容一致) </p> <p align="left" style="margin:10px auto;"> 增加——>修改——>删除 </p> <p align="left" style="margin:10px auto;"> 修改——>修改——>修改 (连续修改测试) </p> <p align="left" style="margin:10px auto;"> 修改——>增加(新增加的内容与修改前内容一致) </p> <p align="left" style="margin:10px auto;"> 修改——>删除 </p> <p align="left" style="margin:10px auto;"> 修改——>删除——>增加 (新增加的内容与删除内容一致) </p> <p align="left" style="margin:10px auto;"> 删除——>删除——>删除 (连续删除测试) </p> <p align="left" style="margin:10px auto;">   </p> <p align="left" style="margin:10px auto;"> <strong>五、注册、登陆模块</strong> </p> <p align="left" style="margin:10px auto;"> 1、注册功能: </p> <p align="left" style="margin:10px auto;"> (1)注册时,设置密码为特殊版本号,检查登录时是否会报错 </p> <p align="left" style="margin:10px auto;"> (2)注册成功后,页面应该以登陆状态跳转到首页或指定页面 </p> <p align="left" style="margin:10px auto;"> (3)在注册信息中删除已输入的信息,检查是否可以注册成功。 </p> <div> <p align="left" style="margin:10px auto;"> 2、登陆 功能: </p> <p align="left" style="margin:10px auto;"> (1)输入正确的用户名和正确的密码 </p> <p align="left" style="margin:10px auto;"> (2)输入正确的用户名和错误的密码 </p> <p align="left" style="margin:10px auto;"> (3)输入错误的用户名和正确的密码 </p> <p align="left" style="margin:10px auto;"> (4)输入错误的用户名和错误的密码 </p> <p align="left" style="margin:10px auto;"> (5)不输入用户名和密码(均为空格) </p> <p align="left" style="margin:10px auto;"> (6)只输入用户名,密码为空 </p> <p align="left" style="margin:10px auto;"> (7)用户名为空,只输入密码 </p> <p align="left" style="margin:10px auto;"> (8)输入正确的用户名和密码,但是不区分大小写 </p> <p align="left" style="margin:10px auto;"> (9)用户名和密码包括特殊字符 </p> <p align="left" style="margin:10px auto;"> (10)用户名和密码输入超长值 </p> <p align="left" style="margin:10px auto;"> (11)已删除的用户名和密码 </p> <p align="left" style="margin:10px auto;"> (12)登录时,当页面刷新或重新输入数据时,验证码是否更新 </p> <p align="left" style="margin:10px auto;">   </p> <p align="left" style="margin:10px auto;"> <strong>六、上传图片<span style="text-decoration:underline;"><strong>测试</strong></span></strong> </p> <p align="left" style="margin:10px auto;"> 1、功能 实现: </p> <p align="left" style="margin:10px auto;"> (1)文件类型正确、大小合适 </p> <p align="left" style="margin:10px auto;"> (2)文件类型正确,大小不合适 </p> <p align="left" style="margin:10px auto;"> (3)文件类型错误,大小合适 </p> <p align="left" style="margin:10px auto;"> (4)文件类型和大小都合适,上传一个正在使用中的图片 </p> <p align="left" style="margin:10px auto;"> (5)文件类型大小都合适,手动输入存在的图片地址来上传 </p> <p align="left" style="margin:10px auto;"> (6)文件类型和大小都合适,输入不存在的图片地址来上传 </p> <p align="left" style="margin:10px auto;"> (7)文件类型和大小都合适,输入图片名称来上传 </p> <p align="left" style="margin:10px auto;"> (8)不选择文件直接点击上传,查看是否给出提示 </p> <p align="left" style="margin:10px auto;"> (9)连续多次选择不同的文件,查看是否上传最后一次选择的文件 </p> <p align="left" style="margin:10px auto;">   </p> <p align="left" style="margin:10px auto;"> <strong>七、查询结果列表</strong> </p> <p align="left" style="margin:10px auto;"> 1、功能 实现: </p> <p align="left" style="margin:10px auto;"> (1)列表、列宽是否合理 </p> <p align="left" style="margin:10px auto;"> (2)列表数据太宽有没有提供横向滚动 </p> <p align="left" style="margin:10px auto;"> (3)列表的列名有没有与内容对应 </p> <p align="left" style="margin:10px auto;"> (4)列表的每列的列名是否描述的清晰 </p> <p align="left" style="margin:10px auto;"> (5)列表是否把不必要的列都显示出来 </p> <p align="left" style="margin:10px auto;"> (6)点击某列进行排序,是否会报错(点击查看每一页的排序是否正确) </p> <p align="left" style="margin:10px auto;"> (7)双击或单击某列信息,是否会报错 </p> <p align="left" style="margin:10px auto;">   </p> <p align="left" style="margin:10px auto;"> <strong>八、返回键检查</strong> </p> <p align="left" style="margin:10px auto;"> 1、一条已经成功提交的记录,返回后再提交,是否做了处理 </p> <p align="left" style="margin:10px auto;"> 2、检查多次使用返回键的情况,在有返回键的地方,返回到原来的页面多次,查看是否会出错 </p> <p align="left" style="margin:10px auto;">   </p> <p align="left" style="margin:10px auto;"> <strong>九、回车键检查</strong> </p> <p align="left" style="margin:10px auto;"> 1、在输入结果后,直接按回车键,看系统如何处理,是否会报错 </p> <p align="left" style="margin:10px auto;">   </p> <p align="left" style="margin:10px auto;"> <strong>十、刷新键检查</strong> </p> <p align="left" style="margin:10px auto;"> 1、在Web系统中,使用刷新键,看系统如何处理,是否会报错 </p> <p align="left" style="margin:10px auto;">   </p> <p align="left" style="margin:10px auto;"> <strong>十一、直接URL链接检查</strong> </p> <p align="left" style="margin:10px auto;"> 1、在Web系统中,在地址栏直接输入各个功能页面的URL地址,看系统如何处理,是否能够直接链接查看(匿名查看),是否有权限控制,是否直接执行,并返回相应结果页; </p> <p align="left" style="margin:10px auto;">   </p> <p align="left" style="margin:10px auto;"> <strong>十二、界面和易用性测试</strong> </p> <p align="left" style="margin:10px auto;"> 1、风格、样式、颜色是否协调 </p> <p style="margin:10px auto;"> 2、界面布局是否整齐、协调(保证全部显示出来的,尽量不要使用滚动条 </p> </div> <table border="0" cellspacing="0" cellpadding="0" style="border:1px solid silver;word-break:break-word;" class="ke-zeroborder"> <tbody> <tr> <td style="border:1px solid silver;border-collapse:collapse;padding:3px;"> <p style="margin:10px auto;"> 3、界面操作、标题描述是否恰当(描述有歧义、注意是否有错别字) </p> </td> </tr> </tbody> </table> <div> <p align="left" style="margin:10px auto;"> 4、操作是否符合人们的常规习惯(有没有把相似的功能的控件放在一起,方便操作) </p> <p align="left" style="margin:10px auto;"> 5、提示界面是否符合规范(不应该显示英文的cancel、ok,应该显示中文的确定等) </p> <p align="left" style="margin:10px auto;"> 6、界面中各个控件是否对齐 </p> <p align="left" style="margin:10px auto;"> 7、日期控件是否可编辑 </p> <p align="left" style="margin:10px auto;"> 8、日期控件的长度是否合理,以修改时可以把时间全部显示出来为准 </p> <p align="left" style="margin:10px auto;"> 9、查询结果列表列宽是否合理、标签描述是否合理 </p> <p align="left" style="margin:10px auto;"> 10、查询结果列表太宽没有横向滚动提示 </p> <p align="left" style="margin:10px auto;"> 11、对于信息比较长的文本,文本框有没有提供自动竖直滚动条 </p> <p align="left" style="margin:10px auto;"> 12、数据录入控件是否方便 </p> <p align="left" style="margin:10px auto;"> 13、有没有支持Tab键,键的顺序要有条理,不乱跳 </p> <p align="left" style="margin:10px auto;"> 14、有没有提供相关的热键 </p> <p align="left" style="margin:10px auto;"> 15、控件的提示语描述是否正确 </p> <p align="left" style="margin:10px auto;"> 16、模块调用是否统一,相同的模块是否调用同一个界面 </p> <p align="left" style="margin:10px auto;"> 17、用滚动条移动页面时,页面的控件是否显示正常 </p> <p align="left" style="margin:10px auto;"> 18、日期的正确格式应该是XXXX-XX-XX或XXXX-XX-XX XX:XX:XX </p> <p align="left" style="margin:10px auto;"> 19、页面是否有多余按钮或标签 </p> <p align="left" style="margin:10px auto;"> 20、窗口标题或图标是否与菜单栏的统一 </p> <p align="left" style="margin:10px auto;"> 21、窗口的最大化、最小化是否能正确切换 </p> <p align="left" style="margin:10px auto;"> 22、对于正常的功能,用户可以不必阅读用户手册就能使用 </p> <p align="left" style="margin:10px auto;"> 23、执行风险操作时,有确认、删除等提示吗 </p> <p align="left" style="margin:10px auto;"> 24、操作顺序是否合理 </p> <p align="left" style="margin:10px auto;"> 25、正确性检查:检查页面上的form, button, table, header, footer,提示信息,还有<span style="text-decoration:underline;"><strong>其他</strong></span>文字拼写,句子的语法等是否正确。 </p> <p align="left" style="margin:10px auto;"> 26、系统应该在用户执行错误的操作之前提出警告,提示信息. </p> <p align="left" style="margin:10px auto;"> 27、页面分辨率检查,在各种分辨率浏览系统检查系统界面友好性。 </p> <p align="left" style="margin:10px auto;"> 28、合理性检查:做delete, update, add, cancel, back等操作后,查看信息回到的页面是否合理。 </p> <p align="left" style="margin:10px auto;"> 29、检查本地化是否通过:英文版不应该有中文信息,英文翻译准确,专业。 </p> <p align="left" style="margin:10px auto;">   </p> <p align="left" style="margin:10px auto;"> <strong>十三、兼容性测试</strong> </p> </div> <p style="margin:10px auto;"> 兼容性测试不只是指界面在不同<span style="text-decoration:underline;"><strong>操作系统</strong></span>或浏览器下的兼容,有些功能方面的测试,也要考虑到兼容性, </p> <div> <p align="left" style="margin:10px auto;"> 包括操作系统兼容和应用软件兼容,可能还包括硬件兼容 </p> </div> <p style="margin:10px auto;"> 比如涉及到<span style="font-family:'Times New Roman';">ajax</span>、<span style="font-family:'Times New Roman';">jquery</span>、<span style="font-family:'Times New Roman';">javascript</span>等技术的,都要考虑到不同浏览器下的兼容性问题。 </p> <p style="margin:10px auto;"> <span style="font-family:'Times New Roman';"> </span> </p> <div> <p align="left" style="margin:10px auto;"> <strong>十四、链接测试</strong> </p> </div> <p style="margin:10px auto;"> 主要是保证链接的可用性和正确性,它也是网站测试中比较重要的一个方面。 </p> <p style="margin:10px auto;"> 可以使用特定的工具如<span style="font-family:'Times New Roman';">XENU</span>来进行链接测试。 </p> <p style="margin:10px auto;"> <span style="font-family:'Times New Roman';">1</span>导航测试<span style="font-family:'Times New Roman';"><br /> </span>导航描述了用户在一个页面内操作的方式,在不同的用户接口控制之间,例如按钮、对话框、列表和窗口等;或在不同的连接页面之间。通过考虑下列问题,可以决定一个<span style="font-family:'Times New Roman';">Web</span>应用系统是否易于导航:导航是否直观?<span style="font-family:'Times New Roman';">Web</span>系统的主要部分是否可通过主页存取?<span style="font-family:'Times New Roman';">Web</span>系统是否需要站点地图、搜索引擎或其他的导航帮助?<br /> 在一个页面上放太多的信息往往起到与预期相反的效果。<span style="font-family:'Times New Roman';">Web</span>应用系统的用户趋向于目的驱动,很快地扫描一个<span style="font-family:'Times New Roman';">Web</span>应用系统,看是否有满足自己需要的信息,如果没有,就会很快地离开。很少有用户愿意花时间去熟悉<span style="font-family:'Times New Roman';">Web</span>应用系统的结构,因此,<span style="font-family:'Times New Roman';">Web</span>应用系统导航帮助要尽可能地准确。<span style="font-family:'Times New Roman';"><br /> </span>导航的另一个重要方面是<span style="font-family:'Times New Roman';">Web</span>应用系统的页面结构、导航、菜单、连接的风格是否一致。确保用户凭直觉就知道<span style="font-family:'Times New Roman';">Web</span>应用系统里面是否还有内容,内容在什么地方。<span style="font-family:'Times New Roman';"><br /> Web</span>应用系统的层次一旦决定,就要着手测试用户导航功能,让最终用户参与这种测试,效果将更加明显。<span style="font-family:'Times New Roman';"><br /> 2</span>图形测试<br /> 在<span style="font-family:'Times New Roman';">Web</span>应用系统中,适当的图片和动画既能起到广告宣传的作用,又能起到美化页面的功能。一个<span style="font-family:'Times New Roman';">Web</span>应用系统的图形可以包括图片、动画、边框、颜色、字体、背景、按钮等。图形测试的内容有:<span style="font-family:'Times New Roman';"><br /> </span>(<span style="font-family:'Times New Roman';">1</span>)要确保图形有明确的用途,图片或动画不要胡乱地堆在一起,以免浪费传输时间。<span style="font-family:'Times New Roman';">Web</span>应用系统的图片尺寸要尽量地小,并且要能清楚地说明某件事情,一般都链接到某个具体的页面。<br /> (<span style="font-family:'Times New Roman';">2</span>)验证所有页面字体的风格是否一致。<br /> (<span style="font-family:'Times New Roman';">3</span>)背景颜色应该与字体颜色和前景颜色相搭配。<br /> (<span style="font-family:'Times New Roman';">4</span>)图片的大小和质量也是一个很重要的因素,一般采用<span style="font-family:'Times New Roman';">JPG</span>或<span style="font-family:'Times New Roman';">GIF</span>压缩,最好能使图片的大小减小到<span style="font-family:'Times New Roman';">30k</span>以下<br /> (<span style="font-family:'Times New Roman';">5</span>)最后,需要验证的是文字回绕是否正确。如果说明文字指向右边的图片,应该确保该图片出现在右边。不要因为使用图片而使窗口和段落排列古怪或者出现孤行。<br /> 通常来说,使用少许或尽量不使用背景是个不错的选择。如果您想用背景,那么最好使用单色的,和导航条一起放在页面的左边。另外,图案和图片可能会转移用户的注意力。 </p> <div> <p align="left" style="margin:10px auto;"> <strong>十五、业务流程测试(主要<span style="text-decoration:underline;"><strong>功能测试</strong></span>)</strong> </p> </div> <p style="margin:10px auto;"> 业务流程,一般会涉及到多个模块的数据,所以在对业务流程测试时,首先要保证单个模块功能的正确性,其次就要对各个模块间传递的数据进行测试,这往往是容易出现问题的地方,测试时一定要设计不同的数据进行测试。 </p> <div> <p align="left" style="margin:10px auto;"> <strong>十六、安全性<span style="text-decoration:underline;"><strong>测试</strong></span></strong> </p> </div> <p style="margin:10px auto;"> (<span style="font-family:'Times New Roman';">1</span>)<span style="font-family:'Times New Roman';"><span style="text-decoration:underline;"><strong>SQL</strong></span></span>注入(比如登陆页面) </p> <p style="margin:10px auto;"> (<span style="font-family:'Times New Roman';">2</span>)<span style="font-family:'Times New Roman';">XSS</span>跨网站脚本攻击:程序或<span style="text-decoration:underline;"><strong>数据库</strong></span>没有对一些特殊字符进行过滤或处理,导致用户所输入的一些破坏性的脚本语句能够直接写进数据库中,浏览器会直接执行这些脚本语句,破坏网站的正常显示,或网站用户的信息被盗<span style="font-family:'Times New Roman';">,</span>构造脚本语句时,要保证脚本的完整性。 </p> <p style="margin:10px auto;">   <span style="font-family:'Times New Roman';">document.write("abc")</span> </p> <p style="margin:10px auto;">   <span style="font-family:'Times New Roman';"><script>alter("abc")</script></span> </p> <p style="margin:10px auto;"> (<span style="font-family:'Times New Roman';">3</span>)<span style="font-family:'Times New Roman';">URL</span>地址后面随便输入一些符号,并尽量是动态参数靠后 </p> <p style="margin:10px auto;"> (<span style="font-family:'Times New Roman';">4</span>)验证码更新问题 </p> <p style="margin:10px auto;"> (<span style="font-family:'Times New Roman';">5</span>)现在的<span style="font-family:'Times New Roman';"><span style="text-decoration:underline;"><strong>Web</strong></span></span>应用系统基本采用先注册,后登陆的方式。因此,必须测试有效和无效的用户名和密码,要注意到是否大小写敏感,可以试多少次的限制,是否可以不登陆而直接浏览某个页面等。 </p> <p style="margin:10px auto;"> (<span style="font-family:'Times New Roman';">6</span>)<span style="font-family:'Times New Roman';">Web</span>应用系统是否有超时的限制,也就是说,用户登陆后在一定时间内(例如<span style="font-family:'Times New Roman';">15</span>分钟)没有点击任何页面,是否需要重新登陆才能正常使用。 </p> <p style="margin:10px auto;"> (<span style="font-family:'Times New Roman';">7</span>)为了保证<span style="font-family:'Times New Roman';">Web</span>应用系统的安全性,<span style="text-decoration:underline;"><strong>日志</strong></span>文件是至关重要的。需要测试相关信息是否写进了日志文件、是否可追踪。 </p> <p style="margin:10px auto;"> (<span style="font-family:'Times New Roman';">8</span>)当使用了安全套接字时,还要测试加密是否正确,检查信息的完整性。 </p> <p style="margin:10px auto;"> (<span style="font-family:'Times New Roman';">9</span>)服务器端的脚本常常构成安全漏洞,这些漏洞又常常被黑客利用。所以,还要测试没有经过授权,就不能在服务器端放置和编辑脚本的问题。 </p> <p style="margin:10px auto;"> <span style="font-family:'Times New Roman';"> </span> </p> <div> <p align="left" style="margin:10px auto;"> <strong>十七、<span style="text-decoration:underline;"><strong>性能测试</strong></span></strong> </p> </div> <p style="margin:10px auto;"> <span style="font-family:'Times New Roman';">1</span>连接速度测试 </p> <p style="margin:10px auto;"> 用户连接到<span style="font-family:'Times New Roman';">Web</span>应用系统的速度根据上网方式的变化而变化,他们或许是电话拨号,或是宽带上网。当下载一个程序时,用户可以等较长的时间,但如果仅仅访问一个页面就不会这样。如果<span style="font-family:'Times New Roman';">Web</span>系统响应时间太长(例如超过<span style="font-family:'Times New Roman';">5</span>秒钟),用户就会因没有耐心等待而离开。 </p> <p style="margin:10px auto;"> 另外,有些页面有超时的限制,如果响应速度太慢,用户可能还没来得及浏览内容,就需要重新登陆了。而且,连接速度太慢,还可能引起数据丢失,使用户得不到真实的页面。 </p> <p style="margin:10px auto;"> <span style="font-family:'Times New Roman';">2</span>负载测试<span style="font-family:'Times New Roman';"><br /> </span>负载测试是为了测量<span style="font-family:'Times New Roman';">Web</span>系统在某一负载级别上的性能,以保证<span style="font-family:'Times New Roman';">Web</span>系统在需求范围内能正常<span style="text-decoration:underline;"><strong>工作</strong></span>。负载级别可以是某个时刻同时访问<span style="font-family:'Times New Roman';">Web</span>系统的用户数量,也可以是在线数据处理的数量。例如:<span style="font-family:'Times New Roman';">Web</span>应用系统能允许多少个用户同时在线?如果超过了这个数量,会出现什么现象?<span style="font-family:'Times New Roman';">Web</span>应用系统能否处理大量用户对同一个页面的请求? </p> <p style="margin:10px auto;"> <span style="font-family:'Times New Roman';">3</span>压力测试<br /> 负载测试应该安排在<span style="font-family:'Times New Roman';">Web</span>系统发布以后,在实际的网络环境中进行测试。因为一个企业内部员工,特别是项目组人员总是有限的,而一个<span style="font-family:'Times New Roman';">Web</span>系统能同时处理的请求数量将远远超出这个限度,所以,只有放在<span style="font-family:'Times New Roman';">Internet</span>上,接受负载测试,其结果才是正确可信的。<span style="font-family:'Times New Roman';"><br /> </span>进行压力测试是指实际破坏一个<span style="font-family:'Times New Roman';">Web</span>应用系统,测试系统的反映。压力测试是测试系统的限制和故障恢复能力,也就是测试<span style="font-family:'Times New Roman';">Web</span>应用系统会不会崩溃,在什么情况下会崩溃。黑客常常提供错误的数据负载,直到<span style="font-family:'Times New Roman';">Web</span>应用系统崩溃,接着当系统重新启动时获得存取权。<br /> 压力测试的区域包括表单、登陆和<span style="text-decoration:underline;"><strong>其他</strong></span>信息传输页面等。 </p> <p style="margin:10px auto;"> <span style="font-family:'Times New Roman';"> </span> </p> <p style="margin:10px auto;"> 备注: </p> <p style="margin:10px auto;"> <span style="font-family:'Times New Roman';">1</span>、负载<span style="font-family:'Times New Roman';">/</span>压力测试应该关注什么 </p> <p style="margin:10px auto;"> 测试需要验证系统能否在同一时间响应大量的用户,在用户传送大量数据的时候能否响应,系统能否长时间运行。可访问性对用户来说是极其重要的。如果用户得到<span style="font-family:'Times New Roman';">“</span>系统忙<span style="font-family:'Times New Roman';">”</span>的信息,他们可能放弃,并转向竞争对手。系统检测不仅要使用户能够正常访问站点,在很多情况下,可能会有黑客试图通过发送大量数据包来攻击服务器。出于安全的原因,测试人员应该知道当系统过载时,需要采取哪些措施,而不是简单地提升系统性能。 </p> <p style="margin:10px auto;"> <span style="font-family:'Times New Roman';">1)</span>瞬间访问高峰<br /> 如果您的站点用于公布彩票的抽奖结果,最好使系统在中奖号码公布后的一段时间内能够响应上百万的请求。负载测试工具能够模拟<span style="font-family:'Times New Roman';">X</span>个用户同时访问测试站点。 </p> <p style="margin:10px auto;"> <span style="font-family:'Times New Roman';">2)</span>每个用户传送大量数据<br /> 网上书店的多数用户可能只订购<span style="font-family:'Times New Roman';">1-5</span>书,但是大学书店可能会订购<span style="font-family:'Times New Roman';">5000</span>本有关心理学介绍的课本<span style="font-family:'Times New Roman';">?</span>或者一个祖母为她的<span style="font-family:'Times New Roman';">50</span>个儿孙购买圣诞礼物<span style="font-family:'Times New Roman';">(</span>当然每个孩子都有自己的邮件地址<span style="font-family:'Times New Roman';">)</span>系统能处理单个用户的大量数据吗<span style="font-family:'Times New Roman';">?</span> </p> <p style="margin:10px auto;"> <span style="font-family:'Times New Roman';">3)</span>长时间的使用<br /> 如果站点用于处理鲜花订单,那么至少希望它在母亲节前的一周内能持续运行。如果站点提供基于<span style="font-family:'Times New Roman';">web</span>的<span style="font-family:'Times New Roman';">email</span>服务,那么点最好能持续运行几个月,甚至几年。可能需要使用自动测试工具来完成这种类型的测试,因为很难通过手工完成这些测试。你可以想象组织<span style="font-family:'Times New Roman';">100</span>个人同时点击某个站点。但是同时组织<span style="font-family:'Times New Roman';">100000</span>个人呢。通常,测试工具在第二次使用的时候,它创造的效益,就足以支付成本。而且,测试工具安装完成之后,再次使用的时候,只要点击几下。<br /> 采取措施:采用性能测试工具<span style="font-family:'Times New Roman';">WAS</span>、<span style="font-family:'Times New Roman';">ACT</span>,<span style="font-family:'Times New Roman';">LR</span>等协助进行测试 </p> <p style="margin:10px auto;"> <span style="font-family:'Times New Roman';"> </span> </p> <div> <p align="left" style="margin:10px auto;"> <strong>十八、测试中应该注意的其他情况</strong> </p> <p align="left" style="margin:10px auto;"> 1、在测试时,与网络有关的步骤或者模块必须考虑到断网的情况 </p> <p align="left" style="margin:10px auto;"> 2、每个页面都有相应的Title,不能为空,或者显示“无标题页” </p> <p align="left" style="margin:10px auto;"> 3、在测试的时候要考虑到页面出现滚动条时,滚动条上下滚动时,页面是否正常 </p> <p align="left" style="margin:10px auto;"> 4、URL不区分大小写,大小写不敏感 </p> <p align="left" style="margin:10px auto;"> 5、、对于电子商务网站,当用户并发购买数量大于库存的数量时,系统如何处理 </p> <p align="left" style="margin:10px auto;"> 6、测试数据避免单纯输入“123”、“abc“之类的,让测试数据尽量接近实际 </p> <p align="left" style="margin:10px auto;"> 7、进行测试时,尽量不要用超级管理员进行测试,用新建的用户进行测试。测试人员尽量不要使用同一个用户进行测试 </p> <p align="left" style="margin:10px auto;"> 8、提示信息:提示信息是否完整、正确、详细 </p> <p align="left" style="margin:10px auto;"> 9、帮助信息:是否提供帮助信息,帮助信息的表现形式(页面文字、提示信息、帮助文件),帮助信息是否正确、详细 </p> <p align="left" style="margin:10px auto;"> 10、可扩展性:是否由升级的余地,是否保留了接口 </p> <p align="left" style="margin:10px auto;"> 11、稳定性:运行所需的软硬件配置,占用资源情况,出现问题时的容错性,对数据的保护 </p> <p align="left" style="margin:10px auto;"> 12、运行速度:运行的快慢,带宽占用情况 </p> </div> </div> </div> <!-- <div class="Blog_con3_1">管理员在2009年8月13日编辑了该文章文章。</div> --> <div class="Blog_con2_1 Blog_con3_2"> <div> <!--<img src="/image/default/tu_8.png">--> <!-- JiaThis Button BEGIN --> <div class="bdsharebuttonbox"><A class=bds_more href="#" data-cmd="more"></A><A class=bds_qzone title=分享到QQ空间 href="#" data-cmd="qzone"></A><A class=bds_tsina title=分享到新浪微博 href="#" data-cmd="tsina"></A><A class=bds_tqq title=分享到腾讯微博 href="#" data-cmd="tqq"></A><A class=bds_renren title=分享到人人网 href="#" data-cmd="renren"></A><A class=bds_weixin title=分享到微信 href="#" data-cmd="weixin"></A></div> <script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script> <!-- JiaThis Button END --> </div> 阅读(1017) | 评论(0) | 转发(0) | <div class="HT_line3"></div> </div> <div class="Blog_con3_3"> <div><span id='digg_num'>0</span><a href="javascript:void(0)" id='digg' bid='4903160' url='/blog/digg.html' ></a></div> <p>上一篇:<a href="/uid-27127953-id-4151289.html">ab 压力测试工具,基于linxe</a></p> <p>下一篇:<a href="/uid-27127953-id-4913559.html">在loadrunner操作中,所碰见问题及解决方法</a></p> </div> </div> <!-- <div class="Blog_con3_4 Blog_con3_5"> <div class="Blog_tit2 Blog_tit7">热门推荐</div> <ul> <li><a href="" title="" target='blank' ></a></li> </ul> </div> --> </div> </div> <div class="Blog_right1_7" id='replyList'> <div class="Blog_tit3">给主人留下些什么吧!~~</div> <!--暂无内容--> <!-- 评论分页--> <div class="Blog_right1_6 Blog_right1_12"> </div> <!-- 评论分页--> <div class="Blog_right1_10" style="display:none"> <div class="Blog_tit3">评论热议</div> <!--未登录 --> <div class="Blog_right1_8"> <div class="nologin_con1"> 请登录后评论。 <p><a href="http://account.chinaunix.net/login" onclick="link(this)">登录</a> <a href="http://account.chinaunix.net/register?url=http%3a%2f%2fblog.chinaunix.net">注册</a></p> </div> </div> </div> <div style="text-align:center;margin-top:10px;"> <script type="text/javascript" smua="d=p&s=b&u=u3118759&w=960&h=90" src="//www.nkscdn.com/smu0/o.js"></script> </div> </div> </div> </div> <input type='hidden' id='report_url' value='/blog/ViewReport.html' /> <script type="text/javascript"> //测试字符串的长度 一个汉字算2个字节 function mb_strlen(str) { var len=str.length; var totalCount=0; for(var i=0;i<len;i++) { var c = str.charCodeAt(i); if ((c >= 0x0001 && c <= 0x007e) || (0xff60<=c && c<=0xff9f)) { totalCount++; }else{ totalCount+=2; } } return totalCount; } /* var Util = {}; Util.calWbText = function (text, max){ if(max === undefined) max = 500; var cLen=0; var matcher = text.match(/[^\x00-\xff]/g), wlen = (matcher && matcher.length) || 0; //匹配url链接正则 http://*** var pattern = /http:\/\/([\w-]+\.)+[\w-]+(\/*[\w-\.\/\?%&=][^\s^\u4e00-\u9fa5]*)?/gi; //匹配的数据存入数组 var arrPt = new Array(); var i = 0; while((result = pattern.exec(text)) != null){ arrPt[i] = result[0]; i++; } //替换掉原文本中的链接 for(var j = 0;j<arrPt.length;j++){ text = text.replace(arrPt[j],""); } //减掉链接所占的长度 return Math.floor((max*2 - text.length - wlen)/2 - 12*i); }; */ var allowComment = '0'; //举报弹出层 function showJuBao(url, cid){ $.cover(false); asyncbox.open({ id : 'report_thickbox', url : url, title : '举报违规', width : 378, height : 240, scroll : 'no', data : { 'cid' : cid, 'idtype' : 2 , 'blogurl' : window.location.href }, callback : function(action){ if(action == 'close'){ $.cover(false); } } }); } $(function(){ //创建管理员删除的弹出层 $('#admin_article_del').click(function(){ $.cover(false); asyncbox.open({ id : 'class_thickbox', html : '<div class="HT_layer3_1"><ul><li class="HT_li1">操作原因:<select class="HT_sel7" id="del_type" name="del_type"><option value="广告文章">广告文章</option><option value="违规内容">违规内容</option><option value="标题不明">标题不明</option><option value="文不对题">文不对题</option></select></li><li class="HT_li1" ><input class="HT_btn4" id="admin_delete" type="button" /></li></ul></div>', title : '选择类型', width : 300, height : 150, scroll : 'no', callback : function(action){ if(action == 'close'){ $.cover(false); } } }); }); $('#admin_delete').live('click' , function(){ ///blog/logicdel/id/3480184/url/%252Fblog%252Findex.html.html var type = $('#del_type').val(); var url = '/blog/logicdel/id/4903160/url/%252Fuid%252F27127953.html.html'; window.location.href= url + '?type=' + type; }); //顶 js中暂未添加&过滤 $('#digg').live('click' , function(){ if(isOnLine == '' ) { //showErrorMsg('登录之后才能进行此操作' , '消息提示'); showErrorMsg('操作失败,您需要先登录!', '消息提示', 'http://account.chinaunix.net/login'); return false; } var bid = $('#digg').attr('bid'); var url = $('#digg').attr('url'); var digg_str = $.cookie('digg_id'); if(digg_str != null) { var arr= new Array(); //定义一数组 arr = digg_str.split(","); //字符分割 for( i=0 ; i < arr.length ; i++ ) { if(bid == arr[i]) { showErrorMsg('已经赞过该文章', '消息提示'); return false; } } } $.ajax({ type:"POST", url:url, data: { 'bid' : bid }, dataType: 'json', success:function(msg){ if(msg.error == 0) { var num = parseInt($('#digg_num').html(),10); num += 1; $('#digg_num').html(num); $('#digg').die(); if(digg_str == null) { $.cookie('digg_id', bid, {expires: 30 , path: '/'}); } else { $.cookie('digg_id', digg_str + ',' + bid, {expires: 30 , path: '/'}); } showSucceedMsg('谢谢' , '消息提示'); } else if(msg.error == 1) { //showErrorMsg(msg.error_content , '消息提示'); showErrorMsg('操作失败,您需要先登录!', '消息提示', 'http://account.chinaunix.net/login'); } else if(msg.error == 2) { showErrorMsg(msg.error_content , '消息提示'); } } }); }); //举报弹出层 /*$('.box_report').live('click' , function(){ if(isOnLine == '' ) { //showErrorMsg('登录之后才能进行此操作' , '消息提示'); showErrorMsg('操作失败,您需要先登录!', '消息提示', 'http://account.chinaunix.net/login'); return false; } var url = $('#report_url').val(); var cid = $(this).attr('cid'); $.cover(false); asyncbox.open({ id : 'report_thickbox', url : url, title : '举报违规', width : 378, height : 240, scroll : 'no', data : { 'cid' : cid, 'idtype' : 2 }, callback : function(action){ if(action == 'close'){ $.cover(false); } } }); });*/ //评论相关代码 //点击回复显示评论框 $('.Blog_a10').live('click' , function(){ if(isOnLine == '' ) { //showErrorMsg('登录之后才能进行此操作' , '消息提示'); showErrorMsg('操作失败,您需要先登录!', '消息提示', 'http://account.chinaunix.net/login'); return false; } if(allowComment == 1) { showErrorMsg('该博文不允许评论' , '消息提示'); return false; } var tid = $(this).attr('toid');//留言作者id var bid = $(this).attr('bid');//blogid var cid = $(this).attr('cid');//留言id var tname = $(this).attr('tname'); var tpl = '<div class="Blog_right1_9">'; tpl += '<div class="div2">'; tpl += '<textarea name="" cols="" rows="" class="Blog_ar1_1" id="rmsg">文明上网,理性发言...</textarea>'; tpl += '</div>'; tpl += '<div class="div3">'; tpl += '<div class="div3_2"><a href="javascript:void(0);" class="Blog_a11" id="quota_sbumit" url="/Comment/PostComment.html" tid="'+tid+'" bid="'+bid+'" cid="'+cid+'" tname="'+tname+'" ></a><a href="javascript:void(0)" id="qx_comment" class="Blog_a12"></a></div>'; tpl += '<div class="div3_1"><a href="javascript:void(0);" id="mface"><span></span>表情</a></div>'; tpl += '<div class="clear"></div>'; tpl += '</div>'; tpl += '</div>'; $('.z_move_comment').html(''); $(this).parents('.Blog_right1_8').find('.z_move_comment').html(tpl).show(); }); //引用的评论提交 $('#quota_sbumit').live('click' , function(){ if(isOnLine == '' ) { //showErrorMsg('登录之后才能进行此操作' , '消息提示'); showErrorMsg('操作失败,您需要先登录!', '消息提示', 'http://account.chinaunix.net/login'); return false; } var bid = $(this).attr('bid'); var tid = $(this).attr('tid');//被引用人的id var qid = $(this).attr('cid');//引用的id var url = $(this).attr('url'); var text = $('#rmsg').val(); var tname = $(this).attr('tname'); if(text == '' || text=='文明上网,理性发言...') { showErrorMsg('评论内容不能为空!' , '消息提示'); return false; } else { if(mb_strlen(text) > 1000){ showErrorMsg('评论内容不能超过500个汉字' , '消息提示'); return false; } } $.ajax({ type: "post", url: url , data: {'bid': bid , 'to' : tid , 'qid' : qid , 'text': text , 'tname' : tname }, dataType: 'json', success: function(data){ if(data.code == 1){ var tpl = '<div class="Blog_right1_8">'; tpl+= '<div class="Blog_right_img1"><a href="' +data.info.url+ '" >' + data.info.header + '</a></div>'; tpl+= '<div class="Blog_right_font1">'; tpl+= '<p class="Blog_p5"><span><a href="' +data.info.url+ '" >' + data.info.username + '</a></span>' + data.info.dateline + '</p>'; tpl+= '<p class="Blog_p7"><a href="' + data.info.quota.url + '">' + data.info.quota.username + '</a>:'+ data.info.quota.content + '</p>'; tpl+= '<p class="Blog_p8">' + data.info.content + '</p><span class="span_text1"><a href="javascript:void(0);" class="Blog_a10" toid=' + data.info.fuid + ' bid=' + data.info.bid + ' cid=' + data.info.cid + ' tname = ' + data.info.username + ' >回复</a> |  <a class="comment_del_mark" style="cursor:pointer" url="' + data.info.delurl + '" >删除</a> |  <a href="javascript:showJuBao(\'/blog/ViewReport.html\','+data.info.cid+')" class="box_report" cid="' + data.info.cid + '" >举报</a></span></div>'; tpl+= '<div class="z_move_comment" style="display:none"></div>'; tpl+= '<div class="Blog_line1"></div></div>'; $('#replyList .Blog_right1_8:first').before(tpl); $('.z_move_comment').html('').hide(); } else if(data.code == -1){ //showErrorMsg(data.info , '消息提示'); showErrorMsg('操作失败,您需要先登录!', '消息提示', 'http://account.chinaunix.net/login'); } }, error: function(){//请求出错处理 } }); }); //底部发表评论 $('#submitmsg').click(function(){ if(allowComment == 1) { showErrorMsg('该博文不允许评论' , '消息提示'); return false; } var bid = $(this).attr('bid'); var toid = $(this).attr('toid'); var text = $('#reply').val(); var url = $(this).attr('url'); if(text == '' || text=='文明上网,理性发言...') { showErrorMsg('评论内容不能为空!' , '消息提示'); return false; } else { if(mb_strlen(text) > 1000){ showErrorMsg('评论内容不能超过500个汉字' , '消息提示'); return false; } } $.ajax({ type: "post", url: url , data: {'bid': bid , 'to' : toid ,'text': text}, dataType: 'json', success: function(data){ if(data.code == 1) { var tpl = '<div class="Blog_right1_8">'; tpl += '<div class="Blog_right_img1"><a href="' +data.info.url+ '" >' + data.info.header + '</a></div>'; tpl += '<div class="Blog_right_font1">'; tpl += '<p class="Blog_p5"><span><a href="' +data.info.url+ '" >' + data.info.username + '</a></span>' + data.info.dateline + '</p>'; tpl += '<p class="Blog_p6">' + data.info.content + '</p>'; tpl += '<div class="div1"><a href="javascript:void(0);" class="Blog_a10" toid=' + data.info.fuid + ' bid=' + data.info.bid + ' cid=' + data.info.cid + '>回复</a> |  <a class="comment_del_mark" style="cursor:pointer" url="' + data.info.delurl + '">删除</a> |  <a href="javascript:showJuBao(\'/blog/ViewReport.html\','+data.info.cid+')" class="box_report" cid="' + data.info.cid + '">举报</a></div>'; tpl += '<div class="z_move_comment" style="display:none"></div>'; tpl += '</div><div class="Blog_line1"></div></div>'; $('.Blog_tit3:first').after(tpl); $('#reply').val('文明上网,理性发言...'); } else if(data.code == -1) { showErrorMsg(data.info , '消息提示'); } }, error: function(){//请求出错处理 } }); }); //底部评论重置 $('#reset_comment').click(function(){ $('#reply').val('文明上网,理性发言...'); }); //取消回复 $('#qx_comment').live('click' , function(){ $('.z_move_comment').html('').hide(); }); $('#rmsg, #reply').live({ focus:function(){ if($(this).val() == '文明上网,理性发言...'){ $(this).val(''); } }, blur:function(){ if($(this).val() == ''){ $(this).val('文明上网,理性发言...'); } } }); //删除留言确认 $('.comment_del_mark').live('click' , function(){ var url = $(this).attr('url'); asyncbox.confirm('删除留言','确认', function(action){ if(action == 'ok') { location.href = url; } }); }); //删除时间确认 $('.del_article_id').click(function(){ var delurl = $(this).attr('delurl'); asyncbox.confirm('删除文章','确认', function(action){ if(action == 'ok') { location.href = delurl; } }); }); /* //字数限制 $('#rmsg, #reply').live('keyup', function(){ var id = $(this).attr('id'); var left = Util.calWbText($(this).val(), 500); var eid = '#errmsg'; if(id == 'reply') eid = '#rerrmsg'; if (left >= 0) $(eid).html('您还可以输入<span>' + left + '</span>字'); else $(eid).html('<font color="red">您已超出<span>' + Math.abs(left) + '</span>字 </font>'); }); */ //加载表情 $('#face').qqFace({id : 'facebox1', assign : 'reply', path : '/image/qqface/'}); $('#mface').qqFace({id : 'facebox', assign : 'rmsg', path:'/image/qqface/'}); /* $('#class_one_id').change(function(){ alert(123213); var id = parseInt($(this).val() , 10); if(id == 0) return false; $('.hidden_son_class span').each(function( index , dom ){ if( dom.attr('cid') == id ) { } }); }); */ //转载文章 var turn_url = "/blog/viewClassPart.html"; $('#repost_bar').click(function(){ if(isOnLine == '' ) { //showErrorMsg('登录之后才能进行此操作' , '消息提示'); showErrorMsg('操作失败,您需要先登录!', '消息提示', 'http://account.chinaunix.net/login'); return false; } var id = $(this).attr('bid'); asyncbox.open({ id : 'turn_class_thickbox', url : turn_url, title : '转载文章', width : 330, height : 131, scroll : 'no', data : { 'id' : id }, callback : function(action){ if(action == 'close'){ $.cover(false); } } }); }); /* //转发文章 $('#repost_bar').live('click' , function(){ if(isOnLine == '' ) { //showErrorMsg('登录之后才能进行此操作' , '消息提示'); showErrorMsg('操作失败,您需要先登录!', '消息提示', 'http://account.chinaunix.net/login'); return false; } var bid = $(this).attr('bid'); var url = $(this).attr('url'); asyncbox.confirm('转载文章','确认', function(action){ if(action == 'ok'){ $.ajax({ type:"POST", url:url, data: { 'bid' : bid }, dataType: 'json', success:function(msg){ if(msg.error == 0){ showSucceedMsg('转发成功!', '消息提示'); }else if(msg.error == 1){ //location.href = '/index.php?r=site/login'; showErrorMsg('操作失败,您需要先登录!', '消息提示', 'http://account.chinaunix.net/login'); }else{ showErrorMsg(msg.error_content, '消息提示'); } } }); } }); }); */ }); </script> <!--该部分应该放在输出代码块的后面才起作用 --> <script type="text/javascript"> SyntaxHighlighter.autoloader( 'applescript /highlight/scripts/shBrushAppleScript.js', 'actionscript3 as3 /highlight/scripts/shBrushAS3.js', 'bash shell /highlight/scripts/shBrushBash.js', 'coldfusion cf /highlight/scripts/shBrushColdFusion.js', 'cpp c /highlight/scripts/shBrushCpp.js', 'c# c-sharp csharp /highlight/scripts/shBrushCSharp.js', 'css /highlight/scripts/shBrushCss.js', 'delphi pascal /highlight/scripts/shBrushDelphi.js', 'diff patch pas /highlight/scripts/shBrushDiff.js', 'erl erlang /highlight/scripts/shBrushErlang.js', 'groovy /highlight/scripts/shBrushGroovy.js', 'java /highlight/scripts/shBrushJava.js', 'jfx javafx /highlight/scripts/shBrushJavaFX.js', 'js jscript javascript /highlight/scripts/shBrushJScript.js', 'perl pl /highlight/scripts/shBrushPerl.js', 'php /highlight/scripts/shBrushPhp.js', 'text plain /highlight/scripts/shBrushPlain.js', 'py python /highlight/scripts/shBrushPython.js', 'ruby rails ror rb /highlight/scripts/shBrushRuby.js', 'scala /highlight/scripts/shBrushScala.js', 'sql /highlight/scripts/shBrushSql.js', 'vb vbnet /highlight/scripts/shBrushVb.js', 'xml xhtml xslt html /highlight/scripts/shBrushXml.js' ); SyntaxHighlighter.all(); function code_hide(id){ var code = document.getElementById(id).style.display; if(code == 'none'){ document.getElementById(id).style.display = 'block'; }else{ document.getElementById(id).style.display = 'none'; } } </script> <!--回顶部js2011.12.30--> <script language="javascript"> lastScrollY=0; function heartBeat(){ var diffY; if (document.documentElement && document.documentElement.scrollTop) diffY = document.documentElement.scrollTop; else if (document.body) diffY = document.body.scrollTop else {/*Netscape stuff*/} percent=.1*(diffY-lastScrollY); if(percent>0)percent=Math.ceil(percent); else percent=Math.floor(percent); document.getElementById("full").style.top=parseInt(document.getElementById("full").style.top)+percent+"px"; lastScrollY=lastScrollY+percent; if(lastScrollY<200) { document.getElementById("full").style.display="none"; } else { document.getElementById("full").style.display="block"; } } var gkuan=document.body.clientWidth; var ks=(gkuan-960)/2-30; suspendcode="<div id=\"full\" style='right:-30px;POSITION:absolute;TOP:500px;z-index:100;width:26px; height:86px;cursor:pointer;'><a href=\"javascript:void(0)\" onclick=\"window.scrollTo(0,0);\"><img src=\"\/image\/top.png\" /></a></div>" document.write(suspendcode); window.setInterval("heartBeat()",1); </script> <!-- footer --> <div class="Blog_footer" style='clear:both'> <div><a href="http://www.chinaunix.net/about/index.shtml" target="_blank" rel="nofollow">关于我们</a> | <a href="http://www.it168.com/bottomfile/it168.shtml" target="_blank" rel="nofollow">关于IT168</a> | <a href="http://www.chinaunix.net/about/connect.html" target="_blank" rel="nofollow">联系方式</a> | <a href="http://www.chinaunix.net/about/service.html" target="_blank" rel="nofollow">广告合作</a> | <a href="http://www.it168.com//bottomfile/flgw/fl.htm" target="_blank" rel="nofollow">法律声明</a> | <a href="http://account.chinaunix.net/register?url=http%3a%2f%2fblog.chinaunix.net" target="_blank" rel="nofollow">免费注册</a> <p>Copyright 2001-2010 ChinaUnix.net All Rights Reserved 北京皓辰网域网络信息技术有限公司. 版权所有 </p> <div>感谢所有关心和支持过ChinaUnix的朋友们 <p><a href="http://beian.miit.gov.cn/">16024965号-6 </a></p> </div> </div> </div> </div> <script language="javascript"> //全局错误提示弹出框 function showErrorMsg(content, title, url){ var url = url || ''; var title = title || '消息提示'; var html = ''; html += '<div class="HT_layer3_1 HT_layer3_2"><ul><li><p><span class="login_span1"></span>' + content + '</p></li>'; if(url == '' || url.length == 0){ html += '<li class="HT_li1"><input type="button" class="HT_btn2" onclick=\'close_windows("error_msg")\'></li>'; } else { html += '<li class="HT_li1"><input type="button" class="login_btn1" onclick="location.href=\'' + url + '\'"></li>'; } html += '</ul></div>'; $.cover(true); asyncbox.open({ id: 'error_msg', title : title, html : html, 'callback' : function(action){ if(action == 'close'){ $.cover(false); } } }); } //全局正确提示 function showSucceedMsg(content, title , url ){ var url = url || ''; var title = title || '消息提示'; var html = ''; html += '<div class="HT_layer3_1 HT_layer3_2"><ul><li><p><span class="login_span2"></span>' + content + '</p></li>'; if(url == '' || url.length == 0){ html += '<li class="HT_li1"><input type="button" class="HT_btn2" onclick=\'close_windows("error_msg")\'></li>'; } else { html += '<li class="HT_li1"><input type="button" class="HT_btn2" onclick="location.href=\'' + url + '\'"></li>'; } html += '</ul></div>'; $.cover(true); asyncbox.open({ id: 'error_msg', title : title, html : html, 'callback' : function(action){ if(action == 'close'){ $.cover(false); } } }); } //关闭指定id的窗口 function close_windows(id){ $.cover(false); $.close(id); } //公告 var tID; var tn; // 高度 var nStopTime = 5000; // 不同行间滚动时间隔的时间,值越小,移动越快 var nSpeed = 50; // 滚动时,向上移动一像素间隔的时间,值越小,移动越快 var isMove = true; var nHeight = 25; var nS = 0; var nNewsCount = 3; /** * n 用于表示是否为第一次运行 **/ function moveT(n) { clearTimeout(tID) var noticev2 = document.getElementById("noticev2") nS = nSpeed; // 只在第一次调用时运行,初始化环境(有没有参数) if (n) { // 设置行高 noticev2.style.lineHeight = nHeight + "px"; // 初始化显示位置 tn = 0; // 刚进入时在第一行停止时间 nS = nStopTime; } // 判断鼠标是否指向层 if (isMove) { // 向上移动一像素 tn--; // 如果移动到最下面一行了,则移到顶行 if (Math.abs(tn) == nNewsCount * nHeight) { tn = 0; } // 设置位置 noticev2.style.marginTop = tn + "px"; // 完整显示一行时,停止一段时间 if (tn % nHeight == 0) { nS = nStopTime; } } tID = setTimeout("moveT()", nS); } moveT(1); // 此处可以传入任何参数 </script> <script type="text/javascript"> // var _gaq = _gaq || []; // _gaq.push(['_setAccount', 'UA-20237423-2']); // _gaq.push(['_setDomainName', '.chinaunix.net']); // _gaq.push(['_trackPageview']); // // (function() { // var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; // ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; // var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); // })(); </script> <script type="text/javascript"> var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://"); document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3F0ee5e8cdc4d43389b3d1bfd76e83216b' type='text/javascript'%3E%3C/script%3E")); function link(t){ var href= $(t).attr('href'); href+="?url="+encodeURIComponent(location.href); $(t).attr('href',href); //setCookie("returnOutUrl", location.href, 60, "/"); } </script> <script type="text/javascript" src="/js/jquery.qqFace.js"></script> </body> </html>