Jar包下载地址
Apache POI-OOXML 4.1.2
https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml/4.1.2
Apache POI 4.1.2
https://mvnrepository.com/artifact/org.apache.poi/poi/4.1.2
Apache Commons Collections 4.4
https://mvnrepository.com/artifact/org.apache.commons/commons-collections4/4.4
Apache Commons IO
https://mvnrepository.com/artifact/commons-io/commons-io
OOXML Schemas
https://mvnrepository.com/artifact/org.apache.poi/ooxml-schemas
XmlBeans 3.1.0
https://mvnrepository.com/artifact/org.apache.xmlbeans/xmlbeans/3.1.0
commons-compress 1.20
https://mvnrepository.com/artifact/org.apache.commons/commons-compress/1.20
在前面使用了那么多种方式的JMeter请求(Requesat)
之后,现在已经可以很容易地创建HTTP Request了,它整体上的使用方式和Postman差不多。
BeanShell脚本
新建一个Test Plan,然后添加Thread Group,再给它添加BeanShell Sampler。
当遇到大规模应用需要模拟上万甚至上十万用户的并发请求时,JMeter单机版的测试模式就行不通了,此时就必须通过Distributed Testing来实现。
并不是所有的机器都有图形界面,所以JMeter也支持通过命令行界面来执行测试,只不过命令行只能执行测试,而不能创建测试脚本。
以之前执行过的Cookie管理器脚本文件CookieManager.jmx
为例,如果想要执行它,就需要这样做。
通过文件测试
除了通过前面演示过的以Post-Processors(后置处理器)的方式来提取数据外,JMeter还可以从文件和数据库中提取数据。
Constant Timer
录制
一个新的操作脚本,如下图所示。
执行测试后的结果显示如下。
从StartTime
字段上看,第一次循环和第二次循环之间间隔了2
秒,也就是16:18:03.173
~16:18:05.115