❶ 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服務換到另外的埠。