BrowserGetOption Function

Action

Gets a BrowserEngine option.

Include file

BrowserAPI.bdh

Syntax

BrowserGetOption( sOption : in string,
                  vValue  : inout union ): boolean;
Parameter Description
sOption The BrowserEngine option to be read. Can be one of the following values:
  • BROWSER_OPT_WAIT_TIMEOUT - A timeout in milliseconds. Silk Performer waits to resolve an element until it is found or the timeout is reached. The default timeout is 5000 ms.

  • BROWSER_OPT_SYNC_TIMEOUT - A timeout in milliseconds after which the synchronization aborts. Synchronization normally waits until the browser is in an idle state. If this state is not achieved, synchronization aborts after the defined timeout. The default timeout is 300000 ms.

  • BROWSER_OPT_SYNC_MODE - The synchronization mode:

    • SYNC_MODE_AJAX - The AJAX mode synchronization waits for the browser to be in a kind of idle state, which is especially useful for AJAX applications or pages that contain AJAX components. Using the AJAX mode eliminates the need to manually script synchronization functions, which eases the script creation process dramatically. This automatic synchronization is also the basis for a successful record and replay approach.
    • SYNC_MODE_HTML - Using the HTML mode ensures that all HTML documents are in an interactive state. With this mode, you can test simple Web pages.
vValue A variable that takes the value.

Return value

  • true if successful

  • false otherwise

Example

benchmark SilkPerformerRecorder

use "Kernel.bdh"
use "BrowserAPI.bdh"

dcluser
  user
    VUser
  transactions
    TInit           : begin;
    TMain           : 1;

var

dclrand

dcltrans
  transaction TInit
  begin
  end TInit;

  transaction TMain
  var
    nWaitTimeout : number;
  begin
    BrowserStart(BROWSER_MODE_DEFAULT, 800, 600);
    
    // get the wait timeout and print it
    BrowserGetOption(BROWSER_OPT_WAIT_TIMEOUT, nWaitTimeout);
    print(string(nWaitTimeout));
    // set the wait timeout to a new value
    BrowserSetOption(BROWSER_OPT_WAIT_TIMEOUT, 6000);
    // revert it back to the old setting
    BrowserSetOption(BROWSER_OPT_WAIT_TIMEOUT, nWaitTimeout);
  end TMain;