Manually Creating a Silk4NET Test

  1. Add a Silk4NET test to your project.
  2. Optional: To add support for controls of a specific application technology, you must include an import statement at the beginning of the test that references the application technology namespace, as shown in the following examples:
    'Visual Basic .NET 
    Imports SilkTest.Ntf.Wpf 
    Imports SilkTest.Ntf.XBrowser 
    Imports SilkTest.Ntf.Win32 
    //C#
    using SilkTest.Ntf.Wpf; 
    using SilkTest.Ntf.XBrowser; 
    using SilkTest.Ntf.Win32;
  3. Configure the base state of the test application. For example:
    'Visual Basic .NET
    Dim baseState = New BrowserBaseState(BrowserType.InternetExplorer, "www.borland.com")  
    baseState.Execute()
    //C# 
    BrowserBaseState baseState = new BrowserBaseState(BrowserType.InternetExplorer, "www.borland.com"); 
    baseState.Execute(); 
    Note: The base state makes sure that the application that you want to test is running and in the foreground. This ensures that tests will always start with the same application state, which makes them more reliable. In order to use the base state, it is necessary to specify what the main window looks like and how to launch the application that you want to test if it is not running. Creating a base state is optional. However, it is recommended as a best practice.
  4. Add test classes and methods that test the desired functionality of the test application.