📄 component_reference.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>JMeter - User's Manual: Component Reference</title>
</head>
<body bgcolor="#ffffff" text="#000000" link="#525D76">
<table border="0" cellspacing="0">
<tr>
<td colspan="2">
<a href="http://jakarta.apache.org"><img width="505" height="48" src="../../docs/images/jakarta-logo.gif" align="left" border="0"></a>
</td>
</tr>
</table>
<table border="0" cellspacing="4">
<tr><td>
<hr noshade size="1">
</td></tr>
<tr>
<td align="left" valign="top">
<table>
<tr>
<td bgcolor="#525D76">
<div align="right"><a href="index.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Index</font></a></div>
</td>
<td bgcolor="#525D76">
<div align="right"><a href="functions.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Next</font></a></div>
</td>
<td bgcolor="#525D76">
<div align="right"><a href="boss.html"><font size=-1 color="#ffffff" face="arial,helvetica,sanserif">Prev</font></a></div>
</td>
</tr>
</table>
<br>
<table width="100%">
<tr><td valign="top">
<ul>
<li><a href="#samplers">18.1 Samplers</a></li>
<ul>
<li>
<a href="#FTP_Request">FTP Request</a></li>
<li>
<a href="#HTTP_Request">HTTP Request</a></li>
<li>
<a href="#JDBC_Request">JDBC Request</a></li>
<li>
<a href="#Java_Request">Java Request</a></li>
<li>
<a href="#SOAP/XML-RPC_Request">SOAP/XML-RPC Request</a></li>
<li>
<a href="#WebService(SOAP)_Request">WebService(SOAP) Request</a></li>
<li>
<a href="#LDAP_Request">LDAP Request</a></li>
<li>
<a href="#LDAP_Extended_Request">LDAP Extended Request</a></li>
<li>
<a href="#Access_Log_Sampler">Access Log Sampler</a></li>
<li>
<a href="#BeanShell_Sampler">BeanShell Sampler</a></li>
<li>
<a href="#BSF_Sampler">BSF Sampler</a></li>
<li>
<a href="#TCP_Sampler">TCP Sampler</a></li>
<li>
<a href="#JMS_Publisher">JMS Publisher</a></li>
<li>
<a href="#JMS_Subscriber">JMS Subscriber</a></li>
<li>
<a href="#JMS_Point-to-Point">JMS Point-to-Point</a></li>
<li>
<a href="#JUnit_Request">JUnit Request</a></li>
<li>
<a href="#Mail_Reader_Sampler">Mail Reader Sampler</a></li>
<li>
<a href="#Test_Action">Test Action</a></li>
</ul>
<li><a href="#logic_controllers">18.2 Logic Controllers</a></li>
<ul>
<li>
<a href="#Simple_Controller">Simple Controller</a></li>
<li>
<a href="#Loop_Controller">Loop Controller</a></li>
<li>
<a href="#Once_Only_Controller">Once Only Controller</a></li>
<li>
<a href="#Interleave_Controller">Interleave Controller</a></li>
<li>
<a href="#Random_Controller">Random Controller</a></li>
<li>
<a href="#Random_Order_Controller">Random Order Controller</a></li>
<li>
<a href="#Throughput_Controller">Throughput Controller</a></li>
<li>
<a href="#Runtime_Controller">Runtime Controller</a></li>
<li>
<a href="#If_Controller">If Controller</a></li>
<li>
<a href="#While_Controller">While Controller</a></li>
<li>
<a href="#Switch_Controller">Switch Controller</a></li>
<li>
<a href="#ForEach_Controller">ForEach Controller</a></li>
<li>
<a href="#Module_Controller">Module Controller</a></li>
<li>
<a href="#Include_Controller">Include Controller</a></li>
<li>
<a href="#Transaction_Controller">Transaction Controller</a></li>
<li>
<a href="#Recording_Controller">Recording Controller</a></li>
</ul>
<li><a href="#listeners">18.3 Listeners</a></li>
<ul>
<li>
<a href="#Sample_Result_Save_Configuration">Sample Result Save Configuration</a></li>
<li>
<a href="#Graph_Full_Results">Graph Full Results</a></li>
<li>
<a href="#Graph_Results">Graph Results</a></li>
<li>
<a href="#Spline_Visualizer">Spline Visualizer</a></li>
<li>
<a href="#Assertion_Results">Assertion Results</a></li>
<li>
<a href="#View_Results_Tree">View Results Tree</a></li>
<li>
<a href="#Aggregate_Report">Aggregate Report</a></li>
<li>
<a href="#View_Results_in_Table">View Results in Table</a></li>
<li>
<a href="#Simple_Data_Writer">Simple Data Writer</a></li>
<li>
<a href="#Monitor_Results">Monitor Results</a></li>
<li>
<a href="#Distribution_Graph_(alpha)">Distribution Graph (alpha)</a></li>
<li>
<a href="#Aggregate_Graph">Aggregate Graph</a></li>
<li>
<a href="#Mailer_Visualizer">Mailer Visualizer</a></li>
<li>
<a href="#BeanShell_Listener">BeanShell Listener</a></li>
<li>
<a href="#Summary_Report">Summary Report</a></li>
</ul>
</ul></td><td valign="top"><ul>
<li><a href="#config_elements">18.4 Configuration Elements</a></li>
<ul>
<li>
<a href="#CSV_Data_Set_Config">CSV Data Set Config</a></li>
<li>
<a href="#FTP_Request_Defaults">FTP Request Defaults</a></li>
<li>
<a href="#HTTP_Authorization_Manager">HTTP Authorization Manager</a></li>
<li>
<a href="#HTTP_Cache_Manager">HTTP Cache Manager</a></li>
<li>
<a href="#HTTP_Cookie_Manager">HTTP Cookie Manager</a></li>
<li>
<a href="#HTTP_Request_Defaults">HTTP Request Defaults</a></li>
<li>
<a href="#HTTP_Header_Manager">HTTP Header Manager</a></li>
<li>
<a href="#Java_Request_Defaults">Java Request Defaults</a></li>
<li>
<a href="#JDBC_Connection_Configuration">JDBC Connection Configuration</a></li>
<li>
<a href="#Login_Config_Element">Login Config Element</a></li>
<li>
<a href="#LDAP_Request_Defaults">LDAP Request Defaults</a></li>
<li>
<a href="#LDAP_Extended_Request_Defaults">LDAP Extended Request Defaults</a></li>
<li>
<a href="#TCP_Sampler_Config">TCP Sampler Config</a></li>
<li>
<a href="#User_Defined_Variables">User Defined Variables</a></li>
<li>
<a href="#Simple_Config_Element">Simple Config Element</a></li>
</ul>
<li><a href="#assertions">18.5 Assertions</a></li>
<ul>
<li>
<a href="#Response_Assertion">Response Assertion</a></li>
<li>
<a href="#Duration_Assertion">Duration Assertion</a></li>
<li>
<a href="#Size_Assertion">Size Assertion</a></li>
<li>
<a href="#XML_Assertion">XML Assertion</a></li>
<li>
<a href="#BeanShell_Assertion">BeanShell Assertion</a></li>
<li>
<a href="#MD5Hex_Assertion">MD5Hex Assertion</a></li>
<li>
<a href="#HTML_Assertion">HTML Assertion</a></li>
<li>
<a href="#XPath_Assertion">XPath Assertion</a></li>
<li>
<a href="#XML_Schema_Assertion">XML Schema Assertion</a></li>
<li>
<a href="#BSF_Assertion">BSF Assertion</a></li>
</ul>
<li><a href="#timers">18.6 Timers</a></li>
<ul>
<li>
<a href="#Constant_Timer">Constant Timer</a></li>
<li>
<a href="#Gaussian_Random_Timer">Gaussian Random Timer</a></li>
<li>
<a href="#Uniform_Random_Timer">Uniform Random Timer</a></li>
<li>
<a href="#Constant_Throughput_Timer">Constant Throughput Timer</a></li>
<li>
<a href="#Synchronizing_Timer">Synchronizing Timer</a></li>
<li>
<a href="#BeanShell_Timer">BeanShell Timer</a></li>
</ul>
<li><a href="#preprocessors">18.7 Pre Processors</a></li>
<ul>
<li>
<a href="#HTML_Link_Parser">HTML Link Parser</a></li>
<li>
<a href="#HTTP_URL_Re-writing_Modifier">HTTP URL Re-writing Modifier</a></li>
<li>
<a href="#HTML_Parameter_Mask">HTML Parameter Mask</a></li>
<li>
<a href="#HTTP_User_Parameter_Modifier">HTTP User Parameter Modifier</a></li>
<li>
<a href="#User_Parameters">User Parameters</a></li>
<li>
<a href="#Counter">Counter</a></li>
<li>
<a href="#BeanShell_PreProcessor">BeanShell PreProcessor</a></li>
<li>
<a href="#BSF_PreProcessor">BSF PreProcessor</a></li>
</ul>
<li><a href="#postprocessors">18.8 Post-Processors</a></li>
<ul>
<li>
<a href="#Regular_Expression_Extractor">Regular Expression Extractor</a></li>
<li>
<a href="#XPath_Extractor">XPath Extractor</a></li>
<li>
<a href="#Result_Status_Action_Handler">Result Status Action Handler</a></li>
<li>
<a href="#Save_Responses_to_a_file">Save Responses to a file</a></li>
<li>
<a href="#Generate_Summary_Results">Generate Summary Results</a></li>
<li>
<a href="#BeanShell_PostProcessor">BeanShell PostProcessor</a></li>
<li>
<a href="#BSF_PostProcessor">BSF PostProcessor</a></li>
</ul>
<li><a href="#Miscellaneous_Features">18.9 Miscellaneous Features</a></li>
<ul>
<li>
<a href="#Test_Plan">Test Plan</a></li>
<li>
<a href="#Thread_Group">Thread Group</a></li>
<li>
<a href="#WorkBench">WorkBench</a></li>
<li>
<a href="#SSL_Manager">SSL Manager</a></li>
<li>
<a href="#HTTP_Proxy_Server">HTTP Proxy Server</a></li>
<li>
<a href="#HTTP_Mirror_Server">HTTP Mirror Server</a></li>
<li>
<a href="#Property_Display">Property Display</a></li>
<li>
<a href="#Debug_Sampler">Debug Sampler</a></li>
<li>
<a href="#Debug_PostProcessor">Debug PostProcessor</a></li>
</ul>
<li><a href="#Reports">18.10 Reports</a></li>
<ul>
<li>
<a href="#Report_Plan">Report Plan</a></li>
<li>
<a href="#Report_Table">Report Table</a></li>
<li>
<a href="#HTML_Report_Writer">HTML Report Writer</a></li>
<li>
<a href="#Report_Page">Report Page</a></li>
<li>
<a href="#Line_Graph">Line Graph</a></li>
<li>
<a href="#Bar_Chart">Bar Chart</a></li>
</ul>
</ul>
</td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="2" width="100%">
<tr><td bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica,sanserif">
<a name="samplers"><strong>18.1 Samplers</strong></a>
</font>
</td></tr>
<tr><td>
<blockquote>
<description>
<p>
Samplers perform the actual work of JMeter.
Each sampler (except Test Action) generates one or more sample results.
The sample results have various attributes (success/fail, elapsed time, data size etc) and can be viewed in the various listeners.
</p>
</description>
<table border="0" cellspacing="0" cellpadding="2">
<tr><td>
<font face="arial,helvetica,sanserif">
<h3><a name="FTP_Request">18.1.1 FTP Request</h3></a>
</font>
</td></tr>
<tr><td>
This controller lets you send an FTP "retrieve file" or "upload file" request to an FTP server.
If you are going to send multiple requests to the same FTP server, consider
using a
<a href="../usermanual/component_reference.html#FTP_Request_Defaults">FTP Request Defaults</a>
Configuration
Element so you do not have to enter the same information for each FTP Request Generative
Controller. When downloading a file, it can be stored on disk (Local File) or in the Response Data, or both.
<p>
Latency is set to the time it takes to login (versions of JMeter after 2.3.1).
</p>
<p><b>Control Panel</b></p>
<div align="center"><img width='502' height='299' src="../../docs/images/screenshots/ftptest/ftp-request.png"></div>
<p>
<b>Parameters</b>
<table border="1" cellspacing="0" cellpadding="2">
<tr><th>Attribute</th><th>Description</th><th>Required</th></tr>
<tr>
<td>Name</td>
<td>Descriptive name for this controller that is shown in the tree.
</td>
<td>
No
</td>
</tr>
<tr>
<td>Server Name or IP</td>
<td>Domain name or IP address of the FTP server.
JMeter assumes the FTP server is listening on the default port.
</td>
<td>
Yes
</td>
</tr>
<tr>
<td>Remote File:</td>
<td>File to retrieve or name of destination file to upload.
</td>
<td>
Yes
</td>
</tr>
<tr>
<td>Local File:</td>
<td>File to upload, or destination for downloads (defaults to remote file name).
</td>
<td>
Yes, if uploading (*)
</td>
</tr>
<tr>
<td>Local File Contents:</td>
<td>Provides the contents for the upload, overrides the Local File property.
</td>
<td>
Yes, if uploading (*)
</td>
</tr>
<tr>
<td>get(RETR) / put(STOR)</td>
<td>Whether to retrieve or upload a file.
</td>
<td>
Yes
</td>
</tr>
<tr>
<td>Use Binary mode ?</td>
<td>Check this to use Binary mode (default Ascii)
</td>
<td>
Yes
</td>
</tr>
<tr>
<td>Save File in Response ?</td>
<td>
Whether to store contents of retrieved file in response data.
If the mode is Ascii, then the contents will be visible in the Tree View Listener.
</td>
<td>
Yes, if downloading
</td>
</tr>
<tr>
<td>Username</td>
<td>FTP account username.
</td>
<td>
Usually
</td>
</tr>
<tr>
<td>Password</td>
<td>FTP account password. N.B. This will be visible in the test plan.
</td>
<td>
Usually
</td>
</tr>
</table>
</p>
<p><b>See Also:</b>
<ul>
<li><a href="test_plan.html#assertions">Assertions</a></li>
<li><a href="../usermanual/component_reference.html#FTP_Request_Defaults">FTP Request Defaults</a>
</li>
<li><a href="build-ftp-test-plan.html">Building an FTP Test Plan</a></li>
</ul>
</p>
</td></tr>
<tr><td><br></td></tr>
</table>
<hr>
<table border="0" cellspacing="0" cellpadding="2">
<tr><td>
<font face="arial,helvetica,sanserif">
<h3><a name="HTTP_Request">18.1.2 HTTP Request</h3></a>
</font>
</td></tr>
<tr><td>
<p>
This sampler lets you send an HTTP/HTTPS request to a web server. It
also lets you control whether or not JMeter parses HTML files for images and
other embedded resources and sends HTTP requests to retrieve them.
The following types of embedded resource are retrieved:
</p>
<ul>
<li>
images
</li>
<li>
applets
</li>
<li>
stylesheets
</li>
<li>
external scripts
</li>
<li>
frames
</li>
<li>
background images (body, table, TD, TR)
</li>
<li>
background sound
</li>
</ul>
<p>
The default parser is htmlparser.
This can be changed by using the property "htmlparser.classname" - see jmeter.properties for details.
</p>
<p>
If you are going to send multiple requests to the same web server, consider
using an
<a href="../usermanual/component_reference.html#HTTP_Request_Defaults">HTTP Request Defaults</a>
Configuration Element so you do not have to enter the same information for each
HTTP Request.
</p>
<p>
Or, instead of manually adding HTTP Requests, you may want to use
JMeter's
<a href="../usermanual/component_reference.html#HTTP_Proxy_Server">HTTP Proxy Server</a>
to create
them. This can save you time if you have a lot of HTTP requests or requests with many
parameters.
</p>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -