当前位置:网站首页>JMeter interface test tool foundation - sampler (II)

JMeter interface test tool foundation - sampler (II)

2022-06-24 10:28:00 Test - Eight Precepts

6) Use keep Alive
When this option is selected ,JMeter And the target server Keep-Alive In a way that HTTP signal communication , Selected by default .
HTTP In request Keep-Alive Mode description :
If a browser has multiple requests for a domain name , There will be frequent connections and disconnections . therefore HTTP 1.0 In the Connection: keep-alive attribute , Used to establish long connections , That's what we're talking about Keep-Alive Pattern .
Keep-Alive Patterns are more efficient , Because it avoids the overhead of frequent connection establishment and release .

7) Yes POST Use multipart/form-data
Use multipart/from-data or application/x-www-form-urlencoded Mode sending HTTP POST request , Not selected by default .
explain POST The encoding type of the request form submission :
multipart/from-data or application/x-www-form-urlencoded It is used to control how to encode the form data before sending it to the server .

enctype attribute explain
application/x-www-form-urlencoded Default encoding , key1=value1&key2=value2.
multipart/form-data Normal form submission , And form file upload .
text/plain Coding in plain text , It doesn't contain any controls or format characters , This method is not commonly used .

8) Browser compatible header (Browser-compatible headers)
When you check multipart/form-data when , Check this box to cut off http In the request header Content-Type and Content-Transfer-Encoding, And just send Content-Disposition part .
Send the parameters with the request :
1) Parameters (Parameters):
Send... With parameters in the request URL ,JMeter Provides a simple way to parameterize . Users can URL All parameters in are set in this table , Each row in the table is a parameter value pair ( Corresponding RUL Medium name 1= value 1).
Coding is the best option , Because if the parameter value contains ASCII Control Chars perhaps Non-ASCII characters Or other symbols , If not checked, the sending will fail ( The code problem ), If checked, these special symbols will be coded automatically

2) Message body data (Body Data):
Data messages sent with requests , Multiple data formats can be supported here json、xml etc. .
for example :
Parameter format :name=zhangsan&age=15 In the form of .( Parameters are in plain text )
Parameter format :json form .( Need configuration http Header Manager , add to Context-Type = application/json)
Be careful :Parameters and Body Data You can only send parameters in one of these ways .

3) Upload files (Files Upload):
Send the file in the request . Usually HTTP File upload behavior can be simulated in this way , The parameter name is the parameter corresponding to the sending file ,MINE Type For resource media type .

(4) Advanced page options

According to the illustration above :
Client implementation (Client implementation):

  • Realization ( Implementation): send out http How to request . Options for Java and HttpClient4, The default is HttpClient4.
    HttpClient4 yes Java How the toolkit implements the request , Is based on .net Kit customization , Efficient .
    If you are uploading a file, you must choose , Otherwise, the request is sent successfully , In fact, the file was not uploaded successfully .
  • Overtime ( millisecond )<Timeouts(milliseconds)>: timeout .
    link (Connect): Connection timeout , The unit is millisecond ;
    Respond to (Response): Response wait timeout , The unit is millisecond ;

from HTML File embedded resources (Embedded Resources from HTML Files):

  • from HTML The file gets all the contained resources (Retrieve All Embedded Resources)
    When this option is selected ,JMeter In a HTTP Requesting and receiving a response HTML After file contents , Also on the HTML To analyze , And get the HTML All the resources contained in ( picture 、flash etc. ), Not selected by default .
    If the user only wants to get specific resources in the page , It can be in the back URLs must match The text box , Fill in the specific resource expression to download , So only those that match the specified regular expression URL The pointing resource will be downloaded .
  • Parallel download (Parallel downloads): Whether to use the self-defined resource pool , Check to set the size .
  • Number (Number): Resource pool size , The default setting is 6.
  • The url must match (URLs must match):URL Matching filter , Fill in this item and only the matching url Resources for .
    for example : To get http://example.com/ All resources under , Using regular expressions http://example.com/.*.

source address :
Used only for http Agreement and Implementation by HttpClient4 The situation of , This property is used to enable IP cheating , Will rewrite this http The default local IP Address .
be used for JMeter The host has multiple IP Address . The value can be the host name 、IP Address or network interface device , Such as “ey0” or “l0” or “wlan0”.
You can set multiple , prevent IP The address is pulled black by the server .

  • IP/ Host name (IP/Hostname): Use specific IP Address or ( Local ) Host name .
  • equipment (Device): Select the first available address for the interface , The device can be IPv4 or IPv6.
  • equipment IPV4: Select the name of the device IPv4 Address .
  • equipment IPV6: Select the name of the device IPv6 Address .

proxy server :
I don't want to use the local address to send Http request , If you want to use a proxy server, fill in .

  • Server name or IP: The name of the proxy server or IP Address .
  • Port number : The port number of the agent .
  • user name : Use the user name of the agent .
  • password : User password .

Save the response as MD5 Hash : Select the , Only the server-side response data is recorded at execution time MD5 value , Without recording the complete response data . When a very large amount of data needs to be tested , It is recommended that this option be selected , To reduce the cost of sampler recording response data .
Come here “HTTP request ” This sampler is over , The page and usage of each sampler are not used , It can't be explained one by one here , What kind of sampler will be used in the future (Samplers) I'll explain it alone .

a key : Supporting learning materials and video teaching

So here I have carefully prepared the detailed information of the above outline in The link below is as follows

 

原网站

版权声明
本文为[Test - Eight Precepts]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/175/202206240921118337.html