⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 component_reference.html

📁 测试工具jmeter可用来进行性能测试
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<td>
No
</td>
</tr>
<tr>
<td>Variable Name</td>
<td>
		Name of the JMeter variable that the connection pool is bound to.
		This must agree with the 'Variable Name' field of a JDBC Connection Configuration.
		
</td>
<td>
Yes
</td>
</tr>
<tr>
<td>Query Type</td>
<td>Set this according to the statement type:
		    
<ul>

		    
<li>
Select Statement
</li>

		    
<li>
Update Statement - use this for Inserts as well
</li>

		    
<li>
Callable Statement
</li>

		    
<li>
Prepared Select Statement
</li>

		    
<li>
Prepared Update Statement - use this for Inserts as well
</li>

		    
<li>
Commit
</li>

		    
<li>
Rollback
</li>

		    
<li>
Autocommit(false)
</li>

		    
<li>
Autocommit(true)
</li>

		    
<li>
Edit - this should be a variable reference that evaluates to one of the above
</li>

		    
</ul>

		
</td>
<td>
Yes
</td>
</tr>
<tr>
<td>SQL Query</td>
<td>
        SQL query.
        Do not enter a trailing semi-colon.
        There is generally no need to use { and } to enclose Callable statements;
        however they mey be used if the database uses a non-standard syntax.
        [The JDBC driver automatically converts the statement if necessary when it is enclosed in {}].
        For example:
        
<ul>

        
<li>
select * from t_customers where id=23
</li>

        
<li>
CALL SYSCS_UTIL.SYSCS_EXPORT_TABLE (null,?, ?, null, null, null)
        
<ul>

        
<li>
Parameter values: tablename,filename
</li>

        
<li>
Parameter types:  VARCHAR,VARCHAR
</li>

        
</ul>

        
</li>

        The second example assumes you are using Apache Derby.
        
</ul>

        
</td>
<td>
Yes
</td>
</tr>
<tr>
<td>Parameter values</td>
<td>
        Comma-separated list of parameter values. Use ]NULL[ to indicate a NULL parameter.
        (If required, the null string can be changed by defining the property "jdbcsampler.nullmarker".)
        
<br>
</br>

        There must be as many values as there are placeholders in the statement.
        
</td>
<td>
Yes, if a prepared or callable statement has parameters
</td>
</tr>
<tr>
<td>Parameter types</td>
<td>
        Comma-separated list of SQL parameter types (e.g. INTEGER, DATE, VARCHAR, DOUBLE).
        If the callable statement has INOUT or OUT parameters, then these must be indicated by prefixing the
        appropriate parameter types, e.g. instead of "INTEGER", use "INOUT INTEGER".
        If not specified, "IN" is assumed, i.e. "DATE" is the same as "IN DATE".
        
<br>
</br>

        There must be as many values as there are placeholders in the statement.
        
</td>
<td>
Yes, if a prepared or callable statement has parameters
</td>
</tr>
</table>
</p>
<p><b>See Also:</b>
<ul>
<li><a href="build-db-test-plan.html">Building a Database Test Plan</a></li>
<li><a href="../usermanual/component_reference.html#JDBC_Connection_Configuration">JDBC Connection Configuration</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="Java_Request">18.1.4 Java Request</h3></a>
</font>
</td></tr>
<tr><td>
<p>
This sampler lets you control a java class that implements the
JavaSamplerClient interface.  By writing your own implementation of this interface,
you can use JMeter to harness multiple threads, input parameter control, and
data collection.
</p>


<p>
The pull-down menu provides the list of all such implementations found by
JMeter in its classpath.  The parameters can then be specified in the
table below - as defined by your implementation.  Two simple examples (JavaTest and SleepTest) are provided.

</p>


<p>

The JavaTest example sampler can be useful for checking test plans, because it allows one to set
values in almost all the fields. These can then be used by Assertions, etc.
The fields allow variables to be used, so the values of these can readily be seen.

</p>


<p><b>Control Panel</b></p>
<div align="center"><img width='406' height='307' src="../../docs/images/screenshots/java_request.png"></div>
<p><table border="1" bgcolor="#bbbb00" width="50%" cellspacing="0" cellpadding="2">
<tr><td>The Add/Delete buttons don't serve any purpose at present.
</td></tr>
</table></p>
<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 sampler
         that is shown in the tree.
</td>
<td>
No
</td>
</tr>
<tr>
<td>Classname</td>
<td>The specific implementation of
        the JavaSamplerClient interface to be sampled.
</td>
<td>
Yes
</td>
</tr>
<tr>
<td>Send Parameters with Request</td>
<td>A list of
        arguments that will be passed to the sampled class.  All arguments
        are sent as Strings.
</td>
<td>
No
</td>
</tr>
</table>
</p>
</td></tr>
<tr><td><br></td></tr>
</table>
<hr>
<p>
The sleep time is calculated as follows:
</p>
<pre>

SleepTime is in milliseconds
SleepMask is used to add a "random" element to the time:
totalSleepTime = SleepTime + (System.currentTimeMillis() % SleepMask)

</pre>
<table border="0" cellspacing="0" cellpadding="2">
<tr><td>
<font face="arial,helvetica,sanserif">
<h3><a name="SOAP/XML-RPC_Request">18.1.5 SOAP/XML-RPC Request</h3></a>
</font>
</td></tr>
<tr><td>
<p>
This sampler lets you send a SOAP request to a webservice.  It can also be
used to send XML-RPC over HTTP.  It creates an HTTP POST request, with the specified XML as the
POST content. 
To change the "Content-type" from the default of "text/html", use a HeaderManager. 
Note that the sampler will use all the headers from the HeaderManager.
If a SOAP action is specified, that will override any SOAPaction in the HeaderManager.
The primary difference between the soap sampler and
webservice sampler, is the soap sampler uses raw post and does not require conformance to
XML.
</p>


<p><table border="1" bgcolor="#bbbb00" width="50%" cellspacing="0" cellpadding="2">
<tr><td>For versions of JMeter later than 2.2, the sampler no longer uses chunked encoding by default.
<br>
</br>

For screen input, it now always uses the size of the data.
<br>
</br>

File input uses the file length as determined by Java.
<br>
</br>

On some OSes this may not work for all files, in which case add a child Header Manager
with Content-Length set to the actual length of the file.
<br>
</br>

Or set Content-Length to -1 to force chunked encoding.

</td></tr>
</table></p>


<p><b>Control Panel</b></p>
<div align="center"><img width='474' height='236' src="../../docs/images/screenshots/soap_sampler.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 sampler
         that is shown in the tree.
</td>
<td>
No
</td>
</tr>
<tr>
<td>URL</td>
<td>The URL to direct the SOAP request to.
</td>
<td>
Yes
</td>
</tr>
<tr>
<td>Send SOAP action</td>
<td>Send a SOAP action header? (overrides the Header Manager)
</td>
<td>
No
</td>
</tr>
<tr>
<td>Soap/XML-RPC Data</td>
<td>The Soap XML message, or XML-RPC instructions.
        Not used if the filename is provided.
        
</td>
<td>
No
</td>
</tr>
<tr>
<td>Filename</td>
<td>If specified, then the contents of the file are sent, and the Data field is ignored
</td>
<td>
No
</td>
</tr>
</table>
</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="WebService(SOAP)_Request">18.1.6 WebService(SOAP) Request</h3></a>
</font>
</td></tr>
<tr><td>
<p>
This sampler has been tested with IIS Webservice running .NET 1.0 and .NET 1.1.
 It has been tested with SUN JWSDP, IBM webservices, Axis and gSoap toolkit for C/C++.
 The sampler uses Apache SOAP driver to serialize the message and set the header
 with the correct SOAPAction. Right now the sampler doesn't support automatic WSDL
 handling, since Apache SOAP currently does not provide support for it. Both IBM
 and SUN provide WSDL drivers. There are 3 options for the post data: text area,
 external file, or directory. If you want the sampler to randomly select a message,
 use the directory. Otherwise, use the text area or a file. The if either the
 file or path are set, it will not use the message in the text area. If you need
 to test a soap service that uses different encoding, use the file or path. If you
 paste the message in to text area, it will not retain the encoding and will result
 in errors. Save your message to a file with the proper encoding, and the sampler
 will read it as java.io.FileInputStream.
</p>

 
<p>
The sampler requires mail.jar and activation.jar. This is because Apache SOAP
 requires the libs. Because mail.jar and activation.jar are distributed by Sun,
 you have to download it separately.
</p>

 
<p>
An important note on the sampler is it will automatically use the proxy host
 and port passed to JMeter from command line, if thoe fields in the sampler are
 left blank. If a sampler has values in the proxy host and port text field, it
 will use the ones provided by the user. This behavior may not be what users
 expect.
</p>

 
<p>
By default, the webservice sampler sets SOAPHTTPConnection.setMaintainSession
 (true). If you need to maintain the session, add a blank Header Manager. The
 sampler uses the Header Manager to store the SOAPHTTPConnection object, since
 there apache soap does provide a easy way to get and set the cookies.
</p>

 
<p>
<b>
Note:
</b>
 If you are using CSVDataSet, do not check "Memory Cache". If memory
 cache is checked, it will not iterate to the next value. That means all the requests
 will use the first value.
</p>

 
<p>
Make sure you use &lt;soap:Envelope rather than &lt;Envelope. For example:
</p>

 
<pre>

&lt;?xml version="1.0" encoding="utf-8"?>
&lt;soap:Envelope 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
&lt;soap:Body>
&lt;foo xmlns="http://clients-xlmns"/>
&lt;/soap:Body>
&lt;/soap:Envelope>

</pre>


<p><b>Control Panel</b></p>
<div align="center"><img width='536' height='934' src="../../docs/images/screenshots/webservice_sampler.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 sampler
         that is shown in the tree.
</td>
<td>
No
</td>
</tr>
<tr>
<td>WSDL URL</td>
<td>The WSDL URL with the service description.
        Versions of JMeter after 2.3.1 support the file: protocol for local WSDL files.
        
</td>
<td>
No
</td>
</tr>
<tr>
<td>Web Methods</td>
<td>Will be populated from the WSDL when the Load WSDL button is pressed.
        Select one of the methods and press the Configure button to populate the Protocol, Server, Port, Path and SOAPAction fields. 
        
</td>
<td>
No
</td>
</tr>
<tr>
<td>Protocol</td>
<td>HTTP or HTTPS are acceptable protocol.
</td>
<td>
Yes
</td>
</tr>
<tr>
<td>Server Name or IP</td>
<td>The hostname or IP address.
</td>
<td>
Yes
</td>
</tr>
<tr>
<td>Port Number</td>
<td>Port Number.
</td>
<td>
Yes
</td>
</tr>
<tr>
<td>Path</td>
<td>Path for the webservice.
</td>
<td>
Yes
</td>
</tr>
<tr>
<td>SOAPAction</td>
<td>The SOAPAction defined in the webservice description or WSDL.
</td>
<td>
Yes
</td>
</tr>
<tr>
<td>Soap/XML-RPC Data</td>
<td>The Soap XML message
</td>
<td>
Yes
</td>
</tr>
<tr>
<td>Soap file</td>
<td>File containing soap message
</td>
<td>
No
</td>
</tr>
<tr>
<td>Message Folder</td>
<td>Folder containing soap files
</td>
<td>
No
</td>
</tr>
<tr>
<td>Memory cache</td>
<td>
        When using external files, setting this causes the file to be processed once and caches the result.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -