With JMeter do interface test, sometimes the number of interfaces more, with recording mode can save a lot of time, recording interface can be used with Badboy, but badboy access to the browser is based on IE6, basically now the site will not be compatible with IE6, Using a proxy to record can skip browser restrictions, which are used by the Chrome browser to do the demo.
1. Create an HTTP request
Start JMeter
Create an HTTP request
--Add Thread Group: Right-click test plan → add →threads → thread Group
--Add HTTP request: Right-click on "xx thread Group" → Add →sampler→http request
Configure HTTP request default values
--Server name or IP (server name or IP) input: www.baidu.com
--Protocol (PROTOCOL) input: http
--Port number input: 80
--Path is left blank
2. Add an HTTP proxy server
Add an HTTP proxy server
--Right click on "Workbench" → add → non-test element →http Proxy Server
Configuring the HTTP proxy server
--Ports (port domain): 8088
--Target controller: test plan >xxxx (thread group name)
--Add "include mode (Patterns to include)": such as ". *\.js" (the recorded request will only contain JS files, the general inclusion mode is not limited by default)
--Add "exclude mode (Patterns to Exclude)": such as ". *\.html" (the recorded request does not contain. HTML requests, generally we do not need HTML pages for interface testing)
Click on the bottom "Start" button, pop-up prompts to click "OK".
3. Configure the browser agent
Start the Chrome browser
Configure browser Proxy
--In Chrome, click Settings-Advanced Settings-Change proxy settings-Select the Connected tab-LAN settings-check "Use a proxy server for your LAN".
--Enter the address and port. Address: localhost or native IP; port: 8088.
--Finally Click "OK".
4. Operation is accessed JMeter interface
The operation is accessed by the JMeter interface.
--Enter in Chrome:
Www.baidu.com
--click on a few links on the page
--Switch to JMeter interface, can proxy to access the request
5. View results--add listener
Add "View results tree"
--Right-click on "xx thread Group" → add → supervisor. Listener → View Tree
--click the "Ctrl+r" button to see the results of the operation
Add an aggregation report
--Right-click on "xx thread Group" → add → supervisor. Listener → View Tree
--click the "Ctrl+r" button to see the results of the operation
Generally delete unwanted requests, processing requests based on business, such as parameterization, adding regular, adding assertions, etc.
JMeter using proxy recording scripts