Silk4NETInit Function

Action

The Silk4NETInit function sets up Silk4NET. 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.
Note: 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

Silk4NETInit( 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
    Silk4NETInit();
  end TInit;

  transaction TTest
  begin
    Silk4NETExecuteTestcase("Silk4NETTest_v12.UnitTest_Notepad_v12","TestMethod_ShortTest","Timer_TestMethod_ShortTest");
		
  end TTest;