BrowserSetBrowserType Function

Action

Sets the browser type to be used for the simulation. Make sure that BrowserSetBrowserType is executed before BrowserStart.
注: BrowserSetBrowserType also overrules the browser defined in the Try Script dialog.

Include file

BrowserAPI.bdh

Syntax

BrowserSetBrowserType( in nBrowserType : number): boolean;
Parameter Description
nBrowserType The following constants can be used:
  • BROWSER_BROWSERTYPE_EMBEDDED_IE: Replays using Internet Explorer.
  • BROWSER_BROWSERTYPE_FIREFOX: Replays using the installed Mozilla Firefox browser.
  • BROWSER_BROWSERTYPE_CHROME: Replays using the installed Google Chrome browser.

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
  begin
    BrowserSetBrowserType(BROWSER_BROWSERTYPE_CHROME);     
    BrowserStart(BROWSER_MODE_DEFAULT, 800, 600); 
  end TMain;