Custom WPF Controls

Generally, Silk4J provides record and playback support for all standard WPF controls.

Silk4J handles custom controls based on the way the custom control is implemented. You can implement custom controls by using the following approaches:
  • Deriving classes from UserControl

    This is a typical way to create compound controls. Silk4J recognizes these user controls as WPFUserControl and provides full support for the contained controls.

  • Deriving classes from standard WPF controls, such as ListBox

    Silk4J treats these controls as an instance of the standard WPF control that they derive from. Record, playback, and recognition of children may not work if the user control behavior differs significantly from its base class implementation.

  • Using standard controls that use templates to change their visual appearance

    Low-level replay might not work in certain cases. Switch to high-level playback mode in such cases. To change the replay mode, use the Script Options dialog box and change the OPT_REPLAY_MODE option.

Silk4J filters out certain controls that are typically not relevant for functional testing. For example, controls that are used for layout purposes are not included. However, if a custom control derives from an excluded class, specify the name of the related WPF class to expose the filtered controls during recording and playback.