Silk4NET

No TrueLog is generated

If you do not have a TrueLog result file after test execution make sure that:

  • The Silk4NET project is executed in the same Visual Studio version as the version in which the project was created. For example, you can only execute a Silk4NET project which is created in Visual Studio 2017 within a Visual Studio 2017 environment. This limitation also applies when you execute the project through the command line or through Team Foundation Server.
  • The test class contains the SilkTestClass attribute.
  • You have write access to the location where the TrueLog file is created.

Silk4NET displays the message "Unit Test Adapter threw exception… "

If you get the error message Unit Test Adapter threw exception… during replay, ensure that the Silk4NET project is executed in the same Visual Studio version as the version in which the project was created. For example, you can only execute a Silk4NET project which is created in Visual Studio 2017 within a Visual Studio 2017 environment. This limitation also applies when you execute the project through the command line or through Team Foundation Server.

How to migrate Silk4NET projects created in a prior version of Visual Studio to a later version of Visual Studio:

  • Open the solution in the prior version of Visual Studio.
  • Change the target framework of your Silk4NET projects to the appropriate version of the .NET Framework. For example, to migrate the projects from Visual Studio 2010 to Visual Studio 2017, set the target framework to .NET Framework 4.5.
  • Remove the reference to the UnitTestingExtension of the prior version of Visual Studio from your Silk4NET projects. For example, if the prior version is Visual Studio 2010, remove the reference to SilkTest.Ntf.VisualStudio2010.UnitTestingExtension from your Silk4NET projects.
  • Add the reference to the later version of Visual Studio to your Silk4NET projects. For example, to migrate the projects to Visual Studio 2017, add the reference SilkTest.Ntf.VisualStudio2017.UnitTestingExtension to your Silk4NET projects.

When you are using object maps, existing locators that do not start with a slash will no longer work

Locators that include only a class name and that do not start with a slash, for example PushButton, will no longer work if object maps exist. This issue might result in breaking existing scripts that were created in a Silk Test version prior to Silk Test 14.0. For the previous example the script will fail with the following error:
Identifier 'PushButton' was not found in the Object Map.

More complex locators that include more than a class name, for example PushButton[@caption=OK] will continue to work, even if object maps exist.

To fix this issue, add a // to the start of any such locator. For example, if the locator PushButton in the following code does no longer work:
PushButton button = mainWindow.find("PushButton");
Change the code to:
PushButton button = mainWindow.find("//PushButton");

Why do I get the message "Could not load 64bit JVM..." when replaying a keyword-driven test?

When replaying a keyword-driven test with Silk4NET 19.5 or later, you might get the following error message:
Could not load 64bit JVM. The test runner is using 32bit. For additional information, see Known Issues > Silk4NET in the help.
To solve this issue, do one of the following:
  • Compile your tests with the platform target x64.
    1. Right-click on the project entry in the Solution Explorer.
    2. Select Properties.
    3. In the Properties Window, select the Build tab.
    4. In the General area, select x64 from the Platform target list.
  • Set the default processor architecture to 64bit. In the Visual Studio menu, select Test > Test Settings > Default Processor Architecture and select X64.
  • To run the keyword-driven tests from the command line with a 64bit platform target, type:
    vstest.console.exe <project name>.dll /platform:x64
  • To use your own 32bit JVM with Silk4NET, set the SILK_KEYWORD_DRIVEN_JAVA_HOME environment variable to the JVM that you want to use.