WebSetOption Function

Action

Allows you to set a variety of web options.

Include file

WebAPI.bdh

Syntax

WebSetOption( in nOption : number,
              in uValue  : union ): boolean;

Return value

  • true if the option was set successfully

  • false otherwise

Parameter Description
nOption

Can be one of the following values:

  • WEB_OPT_EMULATE_DNS - Enables Silk Performer to emulate a DNS lookup mechanism for each virtual user, which is helpful for DNS-based load balancing. If this option is set in combination with a user behavior option, it allows each virtual user to send its individual DNS query to the DNS server.

  • WEB_OPT_ENABLE_CONTENT_ENCODING - Enables Silk Performer to decode compressed data received from the server. If this option is set, Silk Performer sends an Accept-Encoding header to inform the server that encoded data (via gzip and deflated compression methods) can be submitted.

  • WEB_OPT_AUTO_LOAD_IMAGES - Enables the automatic downloading of embedded images. Set nValue to 1 to load the images, or to 0 to not load the images. This option affects the page-level web functions. This function overrides the Automatically load images option in the Emulation category of the Web profile settings.

  • WEB_OPT_LINK_CHECK - Once a document is loaded, all hyperlinks are checked and validated. Set nValue to 1 to check the links, or to 0 to not check the links. This option affects the page-level web functions. (This function overrides the Link checking option in the Verification category of the Web profile settings.)

  • WEB_OPT_HISTORY_SIZE - Sets the history size (maximum number of pages in the history). nValue must be greater than 0. This option affects the page-level web functions.

  • WEB_OPT_MAX_CONN_ATTEMPTS - Determines how often a virtual user will attempt to connect to the server before an error is reported. nValue must be greater than 0.

  • WEB_OPT_HIGH_RES - Used to determine the resolution of the page statistic timers. This parameter is deprecated - it no longer influences precision of timings. The internal resolution of timers is 1 nanosecond.

  • WEB_OPT_TUNNEL_INFO - If the nValue parameter is set to 1, each tunnel request to a proxy server is logged to the TrueLog. Additional authentication requests will be displayed as well. If the nValue parameter is set to 0 (default), no tunnel request information is logged.

  • WEB_OPT_GRACEFUL_SHUTDOWN - By default Silk Performer closes connections using a reset (RST). Set nValue to 1 to use a graceful connection close (FIN) instead.

  • WEB_OPT_STAT_TO_TSD - If this option is enabled (specify a value of STATFLAG_HtmlDoc, STATFLAG_OtherDoc, STATFLAG_RootDoc, or STATFLAG_All), each page-level web function with a timer name adds detailed timers to the time series data. The provided value specifies which portion of the page is to be measured. See WebPageStatToTsd for a detailed description.

  • WEB_OPT_DISABLE_OUTDATA_TRUELOG - Use this option to suppress the logging of Out Header and Out Body information in the TrueLog. This feature can be used to hide sensitive data from the TrueLog.

  • WEB_OPT_DETAILED_PAGE_STAT - Use this option to enable the extended page statistics feature. This allows for browsing of the page tree (as with TrueLog Explorer) and retrieving similar data to that displayed on TrueLog Explorer s Statistics tab. If a value other than 0 is provided, the extended page statistics functionality is enabled. The provided value is also used as the default flag value of the nFlags parameter throughout the WebPageStat functions. Possible values are:

    • PAGE_STAT_FLAG_UseHtml Includes all nodes of the document section of the page (commonly html documents).
    • PAGE_STAT_FLAG_UseEmbedded Includes all nodes of the embedded section of the page (commonly images or scripts).
    • PAGE_STAT_FLAG_NodeTypeLoad Includes all nodes that caused a request to be sent to the server (no cache hits and no suppressed documents).
    • PAGE_STAT_FLAG_NodeTypeCacheHit Includes all nodes that have been found in the cache (full cache hit), so that no request to the server is sent.
    • PAGE_STAT_FLAG_NodeTypeSuppress Includes all nodes for which no request has been sent to the server, because they have been suppressed by the user (WebPageSuppress or WebSetDomainSuppress).
    • PAGE_STAT_FLAG_RedirChainOnlyLast Excludes all nodes but the last of a potential redirection chain (a redirection chain occurs when a request is retried or reissued because of a redirection or a server authentication request).
    • PAGE_STAT_FLAG_AllLoadedDocs is a combination of the flags PAGE_STAT_FLAG_UseHtml, PAGE_STAT_FLAG_UseEmbedded, PAGE_STAT_FLAG_NodeTypeLoad, and PAGE_STAT_FLAG_RedirChainOnlyLast.
    • PAGE_STAT_FLAG_AllLoadedNodes is a combination of the flags PAGE_STAT_FLAG_UseHtml, PAGE_STAT_FLAG_UseEmbedded, and PAGE_STAT_FLAG_NodeTypeLoad.
  • WEB_OPT_SET_FORMS_CASE_SENSITIVE - Comparison between BDL form and HTML form names is normally case-insensitive. Use this option if your server requires case-sensitive form names. To enable case-sensitivity, set the uValue parameter to 1.

  • WEB_OPT_USE_URLHOST_AS_SPN - Use the URL host name as Service Principal Name for Kerberos authentication instead of the fully qualified domain name. To use the URL host name, set the uValue parameter to 1. To use the fully qualified domain name, omit this parameter or set the uValue parameter to 0. This setting must be used if Kerberos authentication does not work when server and client are configured to use CNAME values (see related Microsoft Knowledge Base article).

  • WEB_OPT_NAGLE - Use this option to enable Nagle's algorithm. To turn it on, set the parameter to 2. To turn it off, set it to 1. If the parameter is not set or set to 0, the system's default value is used, which usually enables Nagle's algorithm. Note that low-level TCP/IP projects (for example Terminal Emulation) are the exception. They rely on real-time responses while transmitting small packets of data. For these projects, Silk Performer automatically disables Nagle's algorithm unless specified otherwise by WebSetOption.

  • WEB_OPT_HTTP_VERSION - Use this option to set the preferred HTTP version.
    Note: This option overwrites the preferred HTTP version specified in the profile settings as well as the highest supported HTTP version of the simulated browser.
    Possible values are:
    • HTTP_VERSION_PREFER_10: use HTTP/1.0
    • HTTP_VERSION_PREFER_11: use HTTP/1.1
    • HTTP_VERSION_PREFER_2: use HTTP/2
  • WEB_OPT_HTTP2_ALLOW_HTTP11 - If a server does not support HTTP/2, the attempt to connect to that server through HTTP/2 will fail. For such a case, you can either allow a fallback on HTTP/1.1 or you can prevent such a fallback. Set this option to True to fall back on HTTP/1.1 and to display an informational message. Set this option to False to display an error and to not fall back on an earlier HTTP version.
  • WEB_OPT_HTTP2_ENABLE_SERVER_PUSH - Use this option to enable or disable HTTP/2 server push.

uValue The new value for the selected option.

Example

dcltrans
  transaction TMain 
  var
    nSize: number;
  begin
    // enable link checking
    WebSetOption(WEB_OPT_LINK_CHECK, 1);
    WebPageUrl("http://purple/");
    //check history size
    WebGetOption(WEB_OPT_HISTORY_SIZE, nSize);
    Print(string(nSize));
  end TMain;