How to create support for a Custom WPF Toolkit (Version 2022 or later)

Relevant for version 2022 or later

This task describes how to create, deploy, and test a toolkit support set to extend OpenText Functional Testing's support for a set of custom controls in version 2022 or later. For version 2021 R1 or earlier, see How to create support for a Custom Toolkit (Version 2021 R1 or earlier).

OpenText Functional Testing 2022 and later: Following the discontinuance of the Silverlight development framework, OpenText Functional Testing no longer supports the Silverlight Add-in by default.

If you need to use and extend the Silverlight Add-in, contact OpenText Support.

To create support for a custom WPF toolkit

  • Start by creating a basic toolkit support set with one test object class and minimal functionality changes, and testing that OpenText Functional Testing recognizes it correctly. Then gradually add more complex support and more test object classes, and test those as you add them.

  • To create your WPF Add-in Extensibility files, use the OpenText Functional Testing WPF Custom Support project template that the WPF Add-in Extensibility SDK installs on Visual Studio.

    Using this template helps set up the XML files and the custom server classes that you need to develop in your toolkit support set, simplifying the first three steps in the task described below. For details, see WPF Custom Support Setup Dialog Box (Version 2022 or later).

  1. Define new test object classes for OpenText Functional Testing to use for your custom controls

    1. Create a test object configuration XML file named <custom toolkit name>TestObjects.xml.

      After you deploy your support, OpenText Functional Testing displays this name in the Add-in Manager as a child add-in under the WPF add-in.

    2. In the test object configuration XML file, define new test object classes that extend existing OpenText Functional Testing WPF test object classes (or other WPF Add-in extensibility test object classes).

  2. Map the custom controls to test object classes and custom servers

    In a toolkit configuration XML file, map the custom control types to the test object classes that should represent them in OpenText Functional Testing and to the custom servers that contain the implementation of your support. Create a Control element for each type of control you want to support.

    Name the file <custom toolkit name>.cfg.

    For details on the structure and syntax of a toolkit configuration file, see the Toolkit Configuration Schema.

    WPF Toolkit Configuration File Example:

    <?xml version="1.0" encoding="UTF-8"?>
    <Controls>
        <Control Type="MyCompany.MyDataGrid" MappedTo="MyWpfTable“>
            <CustomServer>
                <Component>
                    <DllName>WpfCustomServers.dll</DllName>
                    <TypeName>
                       MyCompany.MyWpfDataGridCustServer
                    </TypeName>
                </Component>
            </CustomServer>
        </Control>
    </Controls>
    
  3. Design the custom servers that contain the implementation of your support

    Design one custom server for each type of control that you want to support.

    For details, see How to develop a Custom Server.

  4. Deploy the toolkit support set to OpenText Functional Testing

    1. If you have completed the development and are deploying the support set for general use, make sure to set the DevelopmentMode attribute of the TypeInformation element in the test object configuration file to false.

    2. Deploy the toolkit support set by copying the files that you created to the correct locations under the OpenText Functional Testing installation folder. For details, see Developing support for a Custom WPF Toolkit (Version 2022 or later).

  5. Test the functionality of the support you developed

    1. Open OpenText Functional Testing. Ensure that your custom toolkit name is displayed in the Add-in Manager dialog box as a child of the WPF Add-in, and select it. (If the Add-in Manager dialog box does not open when you open OpenText Functional Testing, see the OpenText Functional Testing Help Center for instructions.)

    2. Create and run OpenText Functional Testing tests on your custom controls, and verify that OpenText Functional Testing interacts with your controls as expected. Make sure that:

      • Controls are represented by the expected test object class in the Object Spy and when learning objects.

      • You can successfully create test objects of the classes you defined, using the Define New Test Object dialog box.

      • You can successfully create test steps using your test object classes in the Keyword View, Editor (using the statement completion functionality), and Step Generator.

      • Operations run correctly. Check the run support exposed by the classes based on CustomServerBase (Click, DblClick, on so on). Verify that operations that are not implemented by the custom server are supported by the default OpenText Functional Testing implementation for the base test object type.

      • Table checkpoints and output values function correctly (if relevant).

      • Identification property values are retrieved correctly. Check that identification properties not specifically implemented by the custom server are supported by the base class implementation (when relevant).

      • Operations are recorded correctly both when record implementation is based on Windows messages and when based on events.

      • Your toolkit and its test object classes are properly displayed in the relevant OpenText Functional Testing dialog boxes: For example, Object Identification, Available Keywords (for application areas), and Define New Test Object.

      • Check that elements of WPF that are not part of your support set have not had their functionality changed by installation of your support set.

      • Verify that low level controls that are part of a high level control, as defined in the IComponentDetector implementation are not recognized by OpenText Functional Testing during object identification sessions, such as Record, Learn, and Spy.

  6. Debug your support - Optional

    To use Microsoft Visual Studio debugging tools to debug the support that you developed, attach Visual Studio to the application that contains the custom WPF controls, as the custom servers run in the context of this application.