JMeter Test Plan的组成部分之Assertions
2016-03-27 23:53
507 查看
JMeter Test Plan的组成部分之Assertions
Assertions allow you toinclude some validation test on the response of your request made using a Sampler. They are inserted as
a child component of a Sampler. Assertions are particularly necessary in functional testing of your applications,
while, in performance testing, you may want to use assertion to ensure the responses you receive. Do not contain content errors or missing sections, as this may affect the validity of your test.
With Assertion, you can assert whether the application is returning the expected result or not. JMeter allows you to specify your assertions using Perl-style regular
expressions.
You can create these assertions using regular expressions.
Let's say, you want to ensure that, in an HTTP Request Sampler, the page you request contains the text 'Login Successful' to indicate successful access to a page.
You may use Response Assertion
to specify if the response does contain the text at all. If JMeter cannot find the text, then it will indicate this as failed request.
As an example, the Response Assertion Control Panel
looks like this:
Associated with Assertions are Listeners such as "Assertion", "View Result in Table","View Result Tree", "Aggregate Report" Listener, and "Summary Report" Listeners.
Assertion results will be shown in detail in the first three Listeners, while the rest will show the failed assertions only as summary percentage of failure.
As an example, the Assertion Results Control Panel looks like the following figure:
The following list consists of all the Assertions JMeter provides:
Response Assertion
Duration Assertion
Size Assertion
XML Assertion
BeanShell Assertion
MD5Hex Assertion
HTML Assertion
XPath Assertion
XML Schema Assertion
读书笔记:Apache JMeter
相关文章推荐
- 开放api接口签名验证
- 20145337《Java程序设计》第四周学习总结
- Servlet_处理表单简单案例
- C++中map和hash_map的区别
- vim的几种模式和按键映射(初学者的科普文)
- JavaScript技巧收集
- 51nod 1094 和为k的连续区间
- 11 数学库函数及其使用
- 20145129 《Java程序设计》第4周学习总结
- 并发编程之基础( 四)
- 晴(大风) 18℃ 3.27日
- 每天一篇python:对象篇
- 20145211 《Java程序设计》第4周学习总结——园日涉以成趣
- 2016/3/26 weixin 头像 昵称 网页优化显示 缺表中数据 只有代码 无显示效果
- 汇编写启动代码之设置栈和调用C语言1
- 第四周学习总结
- Weekly Roundup: 补课QAQ
- HDOJ 2043 密码
- 《Java程序设计》第4周学习总结
- Win10 Hyper-v 中安装 CentOS 搭建开发环境