JMeter using proxy recording scripts

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.