❶ jmeter录制的脚本哪些请求可以过滤
使用jmeter进行脚本的录制。
参照jmeter网站上的recording
test的指南文件,结合自己的应用,整理了使用jmeter录制脚本的文档。
1.选中“测试计划”,右键添加“线程组”
2.选中“线程组”,右键添加配置元素:“http请求默认值”,进行设置
设置服务器名称或ip
设置端口号
设置协议
路径为空值
3.选中工作台,右键添加“非测试元件”的“http代理请求”,进行设置
在http代理请求中设置端口号为“8080”
目标控制器选择“测试计划—〉线程组”
设置包含模式及排除模式,若不设置,在录制完之后,可以把不需要的.css
.jpg的行删掉。标准的包含模式及排除模式如下所列。
i.
.*
-
all
ii.
.*.png
–
png
images
iii.
.*.gif
–
gif
images
iv.
.*.jpg
–
jpeg
images
v.
.*.php
vi.
.*.jsp
vii.
.*.html
viii.
.*.htm
ix.
.*.js
4.设置ie的局域网设置
from
the
tool
bar,
click
“tools
->
internet
options”.
this
should
bring
up
the
options.
select
the
“connection”
tab
click
“lan
settings”
button
near
the
bottom.
on
the
connections
tab,
check
“use
a
proxy
server
for
your
lan”.
the
address
and
port
fields
should
be
enabled
now.
address
–
enter
“localhost”
or
the
ip
address
of
your
system(127.0.0.1:8080)
click
“ok”
button
click
“ok”
button
again.
this
should
return
you
to
the
browser
5.点击工作台http代理服务器的启动
6.打开一个ie窗口,输入测试的网址,点击enter,测试计划中将录制http的请求。
7.在测试网页上进行操作,测试计划中继续录制http请求。
注意:
1.ie中局域网的端口号和jmeter中的proxy
server的端口号一致。
2.如果使用自己的机器提供的web服务器,请不要使用8080端口,这样会和jmeter的代理服务冲突。可以修改8080为别的端口或把web服务换到另外的端口。