SetConfiguration Function

Description:

This function lets you specify the HTTP parameters that will be used in all the HTTP requests of a script.

Format:

HTTP configuration

SetConfiguration(HttpUserAgent, user_agent );
SetConfiguration(HttpVersion, http_version);
SetConfiguration(HttpConnection, "Keep-Alive");
SetConfiguration(httpAcceptLanguage, acceptLanguage );
SetConfiguration(HttpAcceptEncoding, acceptEncoding );
SetConfiguration(HttpAcceptPrimary, acceptPrimary );
SetConfiguration(HttpAcceptSecondary, acceptSecondary );
SetConfiguration(HttpProxy, proxyHostPort );
SetConfiguration(HttpsProxy, proxyHostPort );

TCP configuration

SetConfiguration(TcpConnectTimeout, connection_timeout)
SetConfiguration(TcpRecvTimeout1, recv_timeout_1)
SetConfiguration(TcpRecvTimeout2, recv_timeout_2)
 

Parameters:

user_agent

A string expression containing the value to use in the HTTP "User-Agent" header.

http_version

A string expression containing the http version ("HTTP/1.0" or "HTTP/1.1").

proxyHostPort

A string expression containing the proxy server's hostname and port number to be used when sending HTTP requests.
Format: host:port.
The "HTTP_PROXY host_port" option lets you specify HTTP proxy parameters. If this option is set, all of the HTTP requests will be executed through the specified proxy.
If no HTTPS_PROXY options are set, the HTTP proxy options are available for HTTPS requests.

"Keep-Alive"

The "Kepp-Alive" option specifies if the HTTP headers 'Connection: Keep-Alive' or 'Proxy-Connection: Keep-Alive' should be sent as part of HTTP(S) requests.
This allows persistent connections when using HTTP/1.0 protocol, and therefore allows the sending of multiple requests over the same TCP connection. Persistent connections are the default for HTTP/1.1 protocol..

acceptLanguage

A string expression containing the 'Accept-Language' header's value to be sent as part of HTTP requests.

acceptEncoding

A string expression containing the 'Accept-Encoding' header's value to be sent as part of HTTP requests.

acceptPrimary, acceptSecondary

String expressions containing the 'Accept' header's value to be sent as part of of primary/secondary HTTP requests.

connection_timeout

integer containing tcp connection timeout in milliseconds.

recv_timeout_1

integer specifying the timeout in milliseconds for receiving the first TCP packet .

recv_timeout_2

integer specifying the timeout in milliseconds for receiving packets after the first TCP packet has been received.

 

Example:

SetConfiguration(HttpUserAgent, "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.1.4322; .NET CLR 2.0.50727;)");
SetConfiguration(HttpVersion, "HTTP/1.1");
SetConfiguration(HttpConnection, "Keep-Alive");
SetConfiguration(httpAcceptLanguage, "fr,en-us;q=0.5");
SetConfiguration(HttpAcceptEncoding, "gzip, deflate");
SetConfiguration(HttpAcceptPrimary, "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, */*");
SetConfiguration(HttpAcceptSecondary, "*/*");

See Also:





Go back to the Learning center:


Copyright © AgileLoad. All rights reserved.
Agile Load testing tool| Contact AgileLoad | Terms of Use | Sitemap