2.4. Creating CAP instances
Prev | Chapter 2. Writing UI tests via client API | Next

## 2.4. Creating CAP instances

Figure 2.4. JavaFX-Toolkit component factory usage to create an instance for a CheckBox

In order to create executable instances of a org.eclipse.jubula.communication.CAP (Test Step) you have to use the corresponding factory methods available for each toolkit and pass a valid and fitting ComponentIdentifier:

- org.eclipse.jubula.toolkit.javafx.JavafxComponents - see e.g. the Figure 2.4, “JavaFX-Toolkit component factory usage to create an instance for a CheckBox”

- org.eclipse.jubula.toolkit.swing.SwingComponents

- org.eclipse.jubula.toolkit.html.HtmlComponents

- org.eclipse.jubula.toolkit.swt.SwtComponents

On these UI component placeholder instances you can call methods that will return an executable CAP that, when being executed on the AUT connection, performs the specified test step:

Figure 2.5. Creating a CAP instance