| || |
, 06-21-2015 at 01:43 AM (875 Views)
Configuration of JMeter HTTP Request Sampler
Name- Descriptive name for this sampler that is shown in the tree.
Server- Domain name or IP address of the web server. e.g. www.sample.com. [Do not include the http:// prefix.]
Port- Port the web server is listening to. Default: 80
Connect Timeout- Connection Timeout. Number of milliseconds to wait for a connection to open.
Response Timeout- Response Timeout. Number of milliseconds to wait for a response.
Server (proxy)- Hostname or IP address of a proxy server to perform request. [Do not include the http:// prefix.]
Port- Port the proxy server is listening to.
Username- (Optional) username for proxy server.
Password- (Optional) password for proxy server.
Implementation- Java, HttpClient3.1, HttpClient4
Protocol- HTTP, HTTPS or FILE. Default: HTTP
Method- GET, POST, HEAD, TRACE, OPTIONS, PUT, DELETE, PATCH (not supported for JAVA implementation). With HttpClient4, the following methods related to WebDav are also allowed: COPY, LOCK, MKCOL, MOVE, PROPFIND, PROPPATCH, UNLOCK, REPORT, MKCALENDAR.
Content Encoding- Content encoding to be used (for POST, PUT, PATCH and FILE). This the character encoding to be used, and is not related to the Content-Encoding HTTP header.
Redirect Automatically- Sets the underlying http protocol handler to automatically follow redirects, so they are not seen by JMeter, and thus will not appear as samples. Should only be used for GET and HEAD requests.
Follow Redirects- This only has any effect if "Redirect Automatically" is not enabled. If set, the JMeter sampler will check if the response is a redirect and follow it if so.
Use KeepAlive- JMeter sets the Connection: keep-alive header. It does work with the Apache HttpComponents HttpClient implementations.
Use multipart/form-data for HTTP POST- Use a multipart/form-data or application/x-www-form-urlencoded post request
Browser-compatible headers- When using multipart/form-data, this suppresses the Content-Type and Content-Transfer-Encoding headers; only the Content-Disposition header is sent.
Path- The path to resource (for example, /servlets/myServlet)
Send Parameters With the Request- The query string will be generated from the list of parameters you provide. Each parameter has a name and value, the options to encode the parameter, and an option to include or exclude an equals sign (some applications don't expect an equals when the value is the empty string). The query string will be generated in the correct fashion, depending on the choice of "Method" you made (ie if you chose GET or DELETE, the query string will be appended to the URL, if POST or PUT, then it will be sent separately). Also, if you are sending a file using a multipart form, the query string will be created using the multipart form specifications.
Additionally, you can specify whether each parameter should be URL encoded. If you are not sure what this means, it is probably best to select it. If your values contain characters such as the following then encoding is usually required.:
• ASCII Control Chars
• Non-ASCII characters
• Reserved characters:URLs use some characters for special use in defining their syntax. When these characters are not used in their special role inside a URL, they need to be encoded, example : '$', '&', '+', ',' , '/', ':', ';', '=', '?', '@'
• Unsafe characters: Some characters present the possibility of being misunderstood within URLs for various reasons. These characters should also always be encoded, example : ' ', '<', '>', '#', '%', ...
File Path- Name of the file to send. If left blank, JMeter does not send a file, if filled in, JMeter automatically sends the request as a multipart form request.
Parameter name- Value of the "name" web request parameter.
MIME Type- MIME type (for example, text/plain). If it is a POST or PUT or PATCH request and either the 'name' attribute (below) are omitted or the request body is constructed from parameter values only, then the value of this field is used as the value of the content-type request header.
Use as monitor- For use with the Monitor Results listener.
Save response as MD5 hash? - If this is selected, then the response is not stored in the sample result. Instead, the 32 character MD5 hash of the data is calculated and stored instead. This is intended for testing large amounts of data.
Embedded URLs must match- If present, this must be a regular expression that is used to match against any embedded URLs found. So if you only want to download embedded resources from http://sample.com/, use the expression: http://sample\.com/.*
Use concurrent pool- Use a pool of concurrent connections to get embedded resources.
Size- Pool size for concurrent connections used to get embedded resources.
Source address type- [Only for HTTP Request with HTTPClient implementation]
To distinguish the source address value, select the type of these:
• Select IP/Hostname to use a specific IP address or a (local) hostname
• Select Device to pick the first available address for that interface which this may be either IPv4 or IPv6
• Select Device IPv4To select the IPv4 address of the device name (like eth0, lo, em0, etc.)
• Select Device IPv6To select the IPv6 address of the device name (like eth0, lo, em0, etc.)
Source address field- [Only for HTTP Request with HTTPClient implementation]
This property is used to enable IP Spoofing. It override the default local IP address for this sample. The JMeter host must have multiple IP addresses (i.e. IP aliases, network interfaces, devices). The value can be a host name, IP address, or a network interface device such as "eth0" or "lo" or "wlan0". If the property httpclient.localaddress is defined, that is used for all HttpClient requests.
Disclaimer: The article/post is posted with the purpose of sharing knowledge and information.
The article may contain references, extract or content from other informative sources.
Researched/Authored/Compiled by -
Practice Head - Software Testing (QA), CIGNEX Datamatics