SilkKDTInit Function

Action

The SilkKDTInit function loads the JVM and the keyword-driven test is set up. This function is used only for web application testing (but not for mobile) and does not start a new session. Therefore, you need to enable Use particular user account in the system settings: Click Settings > System > Agents > Advanced and enable the option. All started virtual users are using the same Silk Test process within the current session.
注: Browser type settings defined using this function override profile settings that were configured in the profile settings: Profile settings > GUI-Level Testing > Execution > Browser type setting. When the optional uBrowserType parameter is omitted, the profile settings are used. The default browser type is the one that was specified during the import of the test.

Include file

SilkTest.bdh

Syntax

SilkKDTInit( uBrowserType : in number optional := BROWSER_TYPE_DEFAULT ): boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
uBrowserType Optional: Sets the browser type. Possible values are:
  • BROWSER_TYPE_DEFAULT := 0;
  • BROWSER_TYPE_CHROME := 1;
  • BROWSER_TYPE_FIREFOX := 2;
  • BROWSER_TYPE_PHANTOMJS := 3;

Example

dcltrans
  transaction TInit
  begin
    SilkKDTInit();
    SilkTestSetTinkTime(5.0);
  end TInit;
  transaction TTest
  var
    dataset : list of string;
  begin
    SilkKDTExecuteTest("library.zip", "KDTTest", dataset, "KDTTest_Timer");
  end TTest;