JMeter錄制腳本
上一篇
/ 下一篇
2006-12-29 20:36:58
使用JMeter進(jìn)行腳本的錄制。 參照J(rèn)Meter網(wǎng)站上的Recording
Test的指南文件,結(jié)合自己的應(yīng)用,整理了使用JMeter錄制腳本的文檔。 1.選中“測(cè)試計(jì)劃”,右鍵添加“線程組” 2.選中“線程組”,右鍵添加配置元素:“HTTP請(qǐng)求默認(rèn)值”,進(jìn)行設(shè)置 設(shè)置服務(wù)器名稱或IP 設(shè)置端口號(hào) 設(shè)置協(xié)議 路徑為空值
3.選中工作臺(tái),右鍵添加“非測(cè)試元件”的“HTTP代理請(qǐng)求”,進(jìn)行設(shè)置 在HTTP代理請(qǐng)求中設(shè)置端口號(hào)為“8080” 目標(biāo)控制器選擇“測(cè)試計(jì)劃—〉線程組” 設(shè)置包含模式及排除模式,若不設(shè)置,在錄制完之后,可以把不需要的.css
.jpg的行刪掉。標(biāo)準(zhǔn)的包含模式及排除模式如下所列。 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.設(shè)置IE的局域網(wǎng)設(shè)置 From the tool bar, click “tools -> internet options”. This
should bring up the options. Select the “connection” tab Click “l(fā)an
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.點(diǎn)擊工作臺(tái)HTTP代理服務(wù)器的啟動(dòng) 6.打開一個(gè)IE窗口,輸入測(cè)試的網(wǎng)址,點(diǎn)擊enter,測(cè)試計(jì)劃中將錄制HTTP的請(qǐng)求。 7.在測(cè)試網(wǎng)頁(yè)上進(jìn)行操作,測(cè)試計(jì)劃中繼續(xù)錄制HTTP請(qǐng)求。 注意: 1.IE中局域網(wǎng)的端口號(hào)和JMeter中的Proxy
server的端口號(hào)一致。 2.如果使用自己的機(jī)器提供的WEB服務(wù)器,請(qǐng)不要使用8080端口,這樣會(huì)和Jmeter的代理服務(wù)沖突??梢孕薷?080為別的端口或把WEB服務(wù)換到另外的端口。
|