Silk4NETExecuteTestcase Function

Action

Starts an execution using UFT Developer (Silk4NET) and collects the results of the execution.

Include file

SilkTest.bdh

Syntax

Silk4NETExecuteTestcase( in sClass         : string,
                         in sTestCase      : string,
                         in sTimer         : string,
                         in uMSTestVersion : number optional ): boolean;
Parameter Description
sClass The MSTest unit test class name.
sTestCase The name of the test case you want to execute.
sTimer The name of the timer for the Silk4NETExecuteTestcase function. The timer starts when UFT Developer (Silk4NET) gets the information to execute a test case and stops when UFT Developer (Silk4NET) finishes the execution.
uMSTestVersion The version of MSTest or the Visual Studio version that was used to build the test (the .dll file). When this parameter is omitted, the latest version is automatically detected and used. You can use one of the following constants. These constants are also listed in the SilkTest.bdh file.
  • VISUAL_STUDIO_2017_ID := 150
  • VISUAL_STUDIO_2015_ID := 140
  • VISUAL_STUDIO_2013_ID := 120
  • VISUAL_STUDIO_2012_ID := 110
  • VISUAL_STUDIO_2011_ID := 100

Return value

  • true if successful

  • false otherwise

Example

dcltrans
  transaction TInit
  begin
    AttributeGetString("GLTusername",username);
    AttributeGetString("GLTpassword",password);
    Silk4NETInitSession(username,password);
  end TInit;

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