WebSetUserSim Function

Action

This functions allows to adjust the advanced options for the user tolerance simulation.

There are 3 different timeout values, which can be specified for different load states of the page:
  • No response from server (normally the shortest periode)
  • At least the first (root) document is loaded, but the HTML content (frames) is not complete
  • HTML content is complete, but at least one embedded object is missing

Additionally the pure image (embedded objects) load time can be specified, which starts, when the last HTML document is loaded.

In case of a timeout there are several options which the virtual user could take:
  • Retry the page (x times)
  • Do one of the following:
    • Abandon the page
    • Continue waiting - unlimited or unless another timeout occurs
    • Continue waiting for another defined timeout value

Not only the load time tolerance, but also the error accaptance of the virtual user can be controlled by this function. Therefore the number of retries can be specified wether the error happens in the HTML document portion of the page, or in the embedded objects.

Include file

WebAPI.bdh

Syntax

WebSetUserSim(
   in nOption : number,
   in nValue  : number ) : boolean;

Return value

  • true if successful
  • false otherwise
Parameter Description
nOptions
Specify any of the following values:
WEB_USER_SIM_TimeoutNoData
Specifies the maximum time in ms an user is willing to wait when no response from the server arrives.
WEB_USER_SIM_ReloadNoData
Specifies if and how often the user presses the Refresh button in case of above timeout.
WEB_USER_SIM_ActionNoData
Specifies the action the user takes, after the above timeout occures and the page has already been retried the specified times:
Valid values:
WEB_USER_SIM_ACTION_Continue
The user continues waiting; unlimited or until another timeout occurs.
WEB_USER_SIM_ACTION_Abort
The user presses the Stop button - Abandons the page load.
Any positive value
Specifies the amount of ms the user waits additionally before he presses the Stop button.
WEB_USER_SIM_TimeoutDocNotComplete
Specify the maximum time in ms an user is willing to wait when the first (root) document is loaded, but the HTML content (frames) is not complete.
WEB_USER_SIM_ReloadDocNotComplete
Specifies if and how often the user presses the Refresh button in case of above timeout.
WEB_USER_SIM_ActionDocNotComplete
See WEB_USER_SIM_ActionNoData.
WEB_USER_SIM_TimeoutPageNotComplete
Specifies the maximum time in ms an user is willing to wait when the HTML content is complete, but at least one embedded object is missing.
WEB_USER_SIM_ReloadPageNotComplete
Specifies if and how often the user presses the Refresh button in case of above timeout.
WEB_USER_SIM_ActionPageNotComplete
See WEB_USER_SIM_ActionNoData
WEB_USER_SIM_ImgLoadTime
Specifies the maximum time in ms an user is willing to wait for the loading of all embedded objects. This time starts, when the last HTML document is loaded.
WEB_USER_SIM_ReloadImgLoadTimeExceeded
Specifies if and how often the user presses the Refresh button in case of above timeout.
WEB_USER_SIM_ActionImgLoadTimeExceeded
See WEB_USER_SIM_ActionNoData.
WEB_USER_SIM_ReloadPageOnError
Specifies if and how often the user presses the Refresh button in case of any error in the page. (e.g. missing image)
WEB_USER_SIM_ReloadOnlyIfErrorInDocs
Specifies if and how often the user presses the Refresh button in case of any error in the document portion of the page. (e.g. missing frame).
nValue Specify the appropriate value. See nOptions for a description.

Example

dcltrans
  transaction TInit
  begin
   WebSetUserSim(WEB_USER_SIM_ImgLoadTime, 10000);
   WebSetUserSim(WEB_USER_SIM_ReloadImgLoadTimeExceeded, 1);
   WebSetUserSim(WEB_USER_SIM_ActionImgLoadTimeExceeded,
     WEB_USER_SIM_ACTION_Abort);
   WebSetUserSim(WEB_USER_SIM_ReloadOnlyIfErrorInDocs, 1);
  end TInit;